Port from EelLabel to GtkLabel.

* components/hardware/nautilus-hardware-view.c:
	(update_uptime_text), (setup_overview_form):
	* components/music/nautilus-music-view.c:
	* src/file-manager/nautilus-indexing-info.c:
	(update_progress_display):
	* src/nautilus-property-browser.c:
	(nautilus_property_browser_init), (labeled_image_configure),
	(labeled_image_new), (make_category),
	(property_browser_category_button_new),
	(nautilus_property_browser_update_contents):
	* test/test.h:
	* src/nautilus-shell.c:
	* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_init):
	Port from EelLabel to GtkLabel.

	* components/news/nautilus-news.c: (do_destroy),
	(draw_rss_logo_image), (draw_rss_title), (draw_rss_items),
	(nautilus_news_set_title), (free_channel),
	(empty_message_size_allocate), (set_up_main_widgets),
	(make_news_view):
	* libnautilus-private/nautilus-icon-private.h:
	* src/nautilus-sidebar-tabs.c:
	(nautilus_sidebar_tabs_load_theme_data),
	(nautilus_sidebar_tabs_init), (nautilus_sidebar_tabs_destroy),
	(draw_one_tab_plain), (draw_one_tab_themed), (get_tab_width),
	(nautilus_sidebar_tabs_add_view):
	Port to Pango text instead of Eel text.

	* libnautilus-private/nautilus-customization-data.c:
	(add_reset_text):
	* libnautilus-private/nautilus-icon-factory.c:
	(embedded_text_font_changed_callback), (embed_text):
	* src/nautilus-about.c: (draw_aa_string), (draw_author_list),
	(nautilus_about_draw_info), (nautilus_about_update_authors):
	Disable Eel text and ifdef with GNOME2_CONVERSION_COMPLETE.

	* libnautilus-private/nautilus-global-preferences.h:
	* libnautilus-private/nautilus-global-preferences.c:
	Turn off font-related preferences. Maybe delete later or
	convert for Pango fonts.

	* libnautilus-private/nautilus-icon-canvas-item.h:
	* libnautilus-private/nautilus-icon-container.h:
	Remove eel-scalable-font.h includes.

	* src/nautilus-component-adapter-factory.c:
	(nautilus_component_adapter_factory_create_adapter):
	Disable the adapter because it was causing problems.
This commit is contained in:
Darin Adler 2002-01-03 00:11:12 +00:00
parent 2b4a8d9728
commit fa2a9d0085
19 changed files with 233 additions and 229 deletions

View file

@ -1,3 +1,54 @@
2002-01-02 Darin Adler <darin@bentspoon.com>
* components/hardware/nautilus-hardware-view.c:
(update_uptime_text), (setup_overview_form):
* components/music/nautilus-music-view.c:
* src/file-manager/nautilus-indexing-info.c:
(update_progress_display):
* src/nautilus-property-browser.c:
(nautilus_property_browser_init), (labeled_image_configure),
(labeled_image_new), (make_category),
(property_browser_category_button_new),
(nautilus_property_browser_update_contents):
* test/test.h:
* src/nautilus-shell.c:
* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_init):
Port from EelLabel to GtkLabel.
* components/news/nautilus-news.c: (do_destroy),
(draw_rss_logo_image), (draw_rss_title), (draw_rss_items),
(nautilus_news_set_title), (free_channel),
(empty_message_size_allocate), (set_up_main_widgets),
(make_news_view):
* libnautilus-private/nautilus-icon-private.h:
* src/nautilus-sidebar-tabs.c:
(nautilus_sidebar_tabs_load_theme_data),
(nautilus_sidebar_tabs_init), (nautilus_sidebar_tabs_destroy),
(draw_one_tab_plain), (draw_one_tab_themed), (get_tab_width),
(nautilus_sidebar_tabs_add_view):
Port to Pango text instead of Eel text.
* libnautilus-private/nautilus-customization-data.c:
(add_reset_text):
* libnautilus-private/nautilus-icon-factory.c:
(embedded_text_font_changed_callback), (embed_text):
* src/nautilus-about.c: (draw_aa_string), (draw_author_list),
(nautilus_about_draw_info), (nautilus_about_update_authors):
Disable Eel text and ifdef with GNOME2_CONVERSION_COMPLETE.
* libnautilus-private/nautilus-global-preferences.h:
* libnautilus-private/nautilus-global-preferences.c:
Turn off font-related preferences. Maybe delete later or
convert for Pango fonts.
* libnautilus-private/nautilus-icon-canvas-item.h:
* libnautilus-private/nautilus-icon-container.h:
Remove eel-scalable-font.h includes.
* src/nautilus-component-adapter-factory.c:
(nautilus_component_adapter_factory_create_adapter):
Disable the adapter because it was causing problems.
2002-01-02 Frederic Crozat <fcrozat@mandrakesoft.com>
* libnautilus-private/nautilus-directory-background.c:

View file

@ -42,7 +42,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-image.h>
#include <eel/eel-label.h>
#include <libnautilus-private/nautilus-metadata.h>
#include <eel/eel-string.h>
#include <libnautilus/libnautilus.h>
@ -57,7 +56,7 @@ struct _NautilusHardwareViewDetails {
GtkWidget *form;
EelLabel *uptime_label;
GtkLabel *uptime_label;
int timer_task;
int cpu_count;
@ -492,7 +491,7 @@ update_uptime_text (gpointer callback_data)
uptime_minutes = (uptime_seconds - (uptime_days * 86400) - (uptime_hours * 3600)) / 60;
uptime_text = g_strdup_printf (_("Uptime is %d days, %d hours, %d minutes"), uptime_days, uptime_hours, uptime_minutes);
eel_label_set_text (NAUTILUS_HARDWARE_VIEW (callback_data)->details->uptime_label, uptime_text);
gtk_label_set_text (NAUTILUS_HARDWARE_VIEW (callback_data)->details->uptime_label, uptime_text);
g_free (uptime_text);
g_free (uptime_data);
@ -612,9 +611,11 @@ setup_overview_form (NautilusHardwareView *view)
}
/* allocate the uptime label */
view->details->uptime_label = EEL_LABEL (eel_label_new (""));
view->details->uptime_label = GTK_LABEL (gtk_label_new (""));
#if GNOME2_CONVERSION_COMPLETE
eel_label_make_larger (view->details->uptime_label, 2);
eel_label_set_justify (view->details->uptime_label, GTK_JUSTIFY_LEFT);
#endif
gtk_box_pack_end (GTK_BOX (view->details->form), GTK_WIDGET (view->details->uptime_label), 0, 0, GNOME_PAD);
update_uptime_text (view);

View file

@ -44,7 +44,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-image.h>
#include <eel/eel-label.h>
#include <eel/eel-list.h>
#include <eel/eel-preferences.h>
#include <libnautilus-private/nautilus-global-preferences.h>

View file

@ -55,9 +55,6 @@
#include <eel/eel-glib-extensions.h>
#include <eel/eel-graphic-effects.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-label.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-smooth-text-layout.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
@ -124,9 +121,6 @@ typedef struct {
uint update_interval;
int update_timeout;
EelScalableFont *font;
EelScalableFont *bold_font;
gboolean news_changed;
gboolean always_display_title;
gboolean configure_mode;
@ -153,7 +147,7 @@ typedef struct {
char *link_uri;
News *owner;
char *title;
PangoLayout *title;
GdkPixbuf *logo_image;
GList *items;
@ -306,14 +300,6 @@ do_destroy (GtkObject *obj, News *news)
{
g_free (news->uri);
if (news->font) {
g_object_unref (news->font);
}
if (news->bold_font) {
g_object_unref (news->bold_font);
}
if (news->timer_task != 0) {
gtk_timeout_remove (news->timer_task);
news->timer_task = 0;
@ -448,9 +434,11 @@ draw_rss_logo_image (RSSChannelData *channel_data,
char *time_str;
int logo_width, logo_height;
int v_offset, pixbuf_width;
int time_x_pos, time_y_pos;
GdkPixbuf *mapped_image;
#if GNOME2_CONVERSION_COMPLETE
int time_x_pos, time_y_pos;
EelDimensions time_dimensions;
#endif
v_offset = offset;
@ -476,9 +464,11 @@ draw_rss_logo_image (RSSChannelData *channel_data,
if (channel_data->last_update != 0 && !measure_only) {
time_str = eel_strdup_strftime (_("%I:%M %p"), localtime (&channel_data->last_update));
pixbuf_width = gdk_pixbuf_get_width (pixbuf);
#if GNOME2_CONVERSION_COMPLETE
time_dimensions = eel_scalable_font_measure_text (channel_data->owner->font, 9, time_str, strlen (time_str));
pixbuf_width = gdk_pixbuf_get_width (pixbuf);
time_x_pos = pixbuf_width - time_dimensions.width - TIME_MARGIN_OFFSET;
if (time_x_pos >= LOGO_LEFT_OFFSET + logo_width) {
time_y_pos = offset + ((gdk_pixbuf_get_height (channel_data->logo_image) - time_dimensions.height) / 2);
@ -489,6 +479,7 @@ draw_rss_logo_image (RSSChannelData *channel_data,
EEL_RGB_COLOR_BLACK, EEL_OPACITY_FULLY_OPAQUE);
}
g_free (time_str);
#endif
}
}
return v_offset;
@ -501,19 +492,14 @@ draw_rss_title (RSSChannelData *channel_data,
int v_offset,
gboolean measure_only)
{
EelDimensions title_dimensions;
int label_offset;
gboolean is_prelit;
int height;
if (channel_data->title == NULL || channel_data->owner->font == NULL) {
if (channel_data->title == NULL) {
return v_offset;
}
/* first, measure the text */
title_dimensions = eel_scalable_font_measure_text (channel_data->owner->font,
TITLE_FONT_SIZE,
channel_data->title, strlen (channel_data->title));
/* if there is no image, draw the disclosure triangle */
if (channel_data->logo_image == NULL && !measure_only) {
draw_triangle (pixbuf, channel_data, v_offset);
@ -527,16 +513,15 @@ draw_rss_title (RSSChannelData *channel_data,
/* draw the name into the pixbuf using anti-aliased text */
if (!measure_only) {
eel_scalable_font_draw_text (channel_data->owner->font, pixbuf,
label_offset, v_offset,
eel_gdk_pixbuf_whole_pixbuf,
18,
channel_data->title, strlen (channel_data->title),
is_prelit ? EEL_RGBA_COLOR_PACK (0, 0, 128, 255) : EEL_RGB_COLOR_BLACK,
EEL_OPACITY_FULLY_OPAQUE);
eel_gdk_pixbuf_draw_layout (pixbuf,
label_offset, v_offset,
is_prelit ? EEL_RGBA_COLOR_PACK (0, 0, 128, 255) : EEL_RGB_COLOR_BLACK,
channel_data->title);
}
return v_offset + title_dimensions.height;
pango_layout_get_pixel_size (channel_data->title, NULL, &height);
return v_offset + height;
}
/* utility to determine if a uri matches the current one */
@ -556,13 +541,14 @@ draw_rss_items (RSSChannelData *channel_data,
GList *current_item;
RSSItemData *item_data;
int bullet_width, bullet_height, font_size;
gboolean bold;
int item_index, bullet_alpha;
int bullet_x_pos, bullet_y_pos;
guint32 text_color;
#if GNOME2_CONVERSION_COMPLETE
int bullet_x_pos, bullet_y_pos;
ArtIRect dest_bounds;
EelSmoothTextLayout *smooth_text_layout;
#endif
EelDimensions text_dimensions;
EelScalableFont *font;
GdkPixbuf *bullet;
if (channel_data->owner->bullet) {
@ -596,12 +582,9 @@ draw_rss_items (RSSChannelData *channel_data,
font_size = ITEM_FONT_SIZE;
item_data->item_start_y = v_offset;
if (is_current_uri (channel_data->owner, item_data->item_url)) {
font = channel_data->owner->bold_font;
} else {
font = channel_data->owner->font;
}
bold = is_current_uri (channel_data->owner, item_data->item_url);
#if GNOME2_CONVERSION_COMPLETE
smooth_text_layout = eel_smooth_text_layout_new
(item_data->item_title,
eel_strlen (item_data->item_title),
@ -637,6 +620,7 @@ draw_rss_items (RSSChannelData *channel_data,
}
g_object_unref (smooth_text_layout);
#endif
item_data->item_end_y = item_data->item_start_y + text_dimensions.height;
v_offset += text_dimensions.height + 4;
@ -940,17 +924,20 @@ nautilus_news_leave_notify_event (GtkWidget *widget, GdkEventMotion *event, News
static void
nautilus_news_set_title (RSSChannelData *channel_data, const char *title)
{
if (eel_strcmp (channel_data->title, title) == 0) {
return;
}
if (channel_data->title) {
g_free (channel_data->title);
}
if (title != NULL) {
channel_data->title = g_strdup (title);
if (channel_data->title == NULL) {
channel_data->title = pango_layout_new (eel_gtk_widget_get_pango_ft2_context (channel_data->owner->news_display));
} else {
if (strcmp (pango_layout_get_text (channel_data->title), title) == 0) {
return;
}
}
pango_layout_set_text (channel_data->title, title, -1);
} else {
channel_data->title = NULL;
if (channel_data->title != NULL) {
g_object_unref (channel_data->title);
}
channel_data->title = NULL;
}
}
@ -976,7 +963,10 @@ free_channel (RSSChannelData *channel_data)
g_free (channel_data->name);
g_free (channel_data->uri);
g_free (channel_data->link_uri);
g_free (channel_data->title);
if (channel_data->title != NULL) {
g_object_unref (channel_data->title);
}
if (channel_data->logo_image != NULL) {
g_object_unref (channel_data->logo_image);
@ -2202,7 +2192,9 @@ empty_message_size_allocate (GtkWidget *widget, GtkAllocation *allocation, News
wrap_width = allocation->width - 2*EMPTY_MESSAGE_MARGIN;
if (wrap_width > 0) {
#if GNOME2_CONVERSION_COMPLETE
eel_label_set_smooth_line_wrap_width (EEL_LABEL (widget), allocation->width - 2*EMPTY_MESSAGE_MARGIN);
#endif
}
}
@ -2422,10 +2414,12 @@ set_up_main_widgets (News *news, GtkWidget *container)
news->news_display_scrolled_window = scrolled_window;
/* add the empty message */
news->empty_message = eel_label_new (_("The News panel displays current headlines from your favorite websites. Click the \'Select Sites\' button to select the sites to display."));
news->empty_message = gtk_label_new (_("The News panel displays current headlines from your favorite websites. Click the \'Select Sites\' button to select the sites to display."));
#if GNOME2_CONVERSION_COMPLETE
eel_label_set_smooth_font_size (EEL_LABEL (news->empty_message), 14);
eel_label_set_justify (EEL_LABEL (news->empty_message), GTK_JUSTIFY_LEFT);
eel_label_set_wrap (EEL_LABEL (news->empty_message), TRUE);
#endif
gtk_box_pack_start (GTK_BOX (news->main_box), news->empty_message, TRUE,
TRUE, 0);
@ -2471,10 +2465,6 @@ make_news_view (const char *iid, gpointer callback_data)
set_up_configure_widgets (news, main_container);
set_up_edit_widgets (news, main_container);
/* set up the fonts */
news->font = eel_scalable_font_get_default_font ();
news->bold_font = eel_scalable_font_get_default_bold_font ();
/* get preferences and sanity check them */
news->max_item_count = eel_preferences_get_integer (NAUTILUS_PREFERENCES_NEWS_MAX_ITEMS);
news->update_interval = 60 * eel_preferences_get_integer (NAUTILUS_PREFERENCES_NEWS_UPDATE_INTERVAL);

View file

@ -42,15 +42,14 @@
#include <stdlib.h>
#include "nautilus-customization-data.h"
#include "nautilus-file-utilities.h"
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include "nautilus-file-utilities.h"
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-xml-extensions.h>
#include <eel/eel-string.h>
#include <eel/eel-xml-extensions.h>
typedef enum {
READ_PUBLIC_CUSTOMIZATIONS,
@ -344,19 +343,21 @@ static void
add_reset_text (GdkPixbuf *pixbuf)
{
char *reset_text;
EelScalableFont *font;
EelDimensions title_dimensions;
int width, height;
int font_size, text_len;
int text_len;
#if GNOME2_CONVERSION_COMPLETE
EelDimensions title_dimensions;
int font_size;
int h_offset, v_offset;
#endif
font = eel_scalable_font_get_default_font ();
reset_text = _("reset");
text_len = strlen (reset_text);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
#if GNOME2_CONVERSION_COMPLETE
font_size = eel_scalable_font_largest_fitting_font_size (font, reset_text, width - 12, 12, 36);
title_dimensions = eel_scalable_font_measure_text (font, font_size, reset_text, text_len);
@ -373,6 +374,7 @@ add_reset_text (GdkPixbuf *pixbuf)
EEL_OPACITY_FULLY_OPAQUE);
g_object_unref (font);
#endif
}
/* utility to make an attractive pattern image by compositing with a frame */

View file

@ -34,7 +34,6 @@
#include <eel/eel-font-manager.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-smooth-widget.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
@ -909,6 +908,9 @@ default_home_location_callback (int user_level)
/*
* Public functions
*/
#if GNOME2_CONVERSION_COMPLETE
static EelScalableFont *
global_preferences_get_smooth_font (const char *smooth_font_file_name)
{
@ -981,6 +983,8 @@ nautilus_global_preferences_get_default_smooth_bold_font (void)
return global_preferences_get_smooth_bold_font (default_smooth_font_auto_value);
}
#endif
/* Let the smooth widget machinery know about smoothness changes */
static void
smooth_graphics_mode_changed_callback (gpointer callback_data)

View file

@ -23,8 +23,8 @@
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#ifndef NAUTILUS_PREFS_GLOBAL_H
#define NAUTILUS_PREFS_GLOBAL_H
#ifndef NAUTILUS_GLOBAL_PREFERENCES_H
#define NAUTILUS_GLOBAL_PREFERENCES_H
#include <eel/eel-preferences.h>
@ -187,17 +187,9 @@ typedef enum
/* Gnome session management */
#define NAUTILUS_PREFERENCES_ADD_TO_SESSION "preferences/add_to_session"
void nautilus_global_preferences_init (void);
/* Sidebar */
struct EelScalableFont *nautilus_global_preferences_get_icon_view_smooth_font (void);
struct EelScalableFont *nautilus_global_preferences_get_default_smooth_font (void);
struct EelScalableFont *nautilus_global_preferences_get_default_smooth_bold_font (void);
void nautilus_global_preferences_set_default_folder_viewer (const char *iid);
void nautilus_global_preferences_init (void);
void nautilus_global_preferences_set_default_folder_viewer (const char *iid);
G_END_DECLS
#endif /* NAUTILUS_PREFS_GLOBAL_H */
#endif /* NAUTILUS_GLOBAL_PREFERENCES_H */

View file

@ -28,7 +28,6 @@
#include <libgnomecanvas/gnome-canvas.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "nautilus-icon-factory.h"
#include <eel/eel-scalable-font.h>
G_BEGIN_DECLS

View file

@ -28,7 +28,6 @@
#include <libgnomecanvas/gnome-canvas.h>
#include "nautilus-icon-factory.h"
#include <eel/eel-scalable-font.h>
#define NAUTILUS_ICON_CONTAINER(obj) \
GTK_CHECK_CAST (obj, nautilus_icon_container_get_type (), NautilusIconContainer)

View file

@ -44,7 +44,6 @@
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-string.h>
#include <eel/eel-vfs-extensions.h>
#include <gtk/gtksignal.h>
@ -59,12 +58,6 @@
#include <stdio.h>
#include <string.h>
#define USE_EEL_TEXT
#ifdef USE_EEL_TEXT
#include <eel/eel-smooth-text-layout.h>
#endif
#define ICON_NAME_BLOCK_DEVICE "i-blockdev"
#define ICON_NAME_BROKEN_SYMBOLIC_LINK "i-symlink"
#define ICON_NAME_CHARACTER_DEVICE "i-chardev"
@ -2235,13 +2228,17 @@ embedded_text_rect_usable (ArtIRect embedded_text_rect)
return TRUE;
}
#if GNOME2_CONVERSION_COMPLETE
static gboolean embedded_text_preferences_callbacks_added = FALSE;
static EelScalableFont *embedded_text_font = NULL;
static void
embedded_text_font_changed_callback (gpointer callback_data)
{
gboolean clear_cache = GPOINTER_TO_INT (callback_data);
gboolean clear_cache;
clear_cache = GPOINTER_TO_INT (callback_data);
embedded_text_font = nautilus_global_preferences_get_default_smooth_font ();
@ -2261,12 +2258,13 @@ embedded_text_font_free (void)
embedded_text_font = NULL;
}
#endif
static GdkPixbuf *
embed_text (GdkPixbuf *pixbuf_without_text,
ArtIRect embedded_text_rect,
const char *text)
{
EelSmoothTextLayout *smooth_text_layout;
GdkPixbuf *pixbuf_with_text;
g_return_val_if_fail (pixbuf_without_text != NULL, NULL);
@ -2279,7 +2277,8 @@ embed_text (GdkPixbuf *pixbuf_without_text,
}
/* Listen for changes in embedded text (icon text preview) font preferences */
if (embedded_text_preferences_callbacks_added == FALSE) {
#if GNOME2_CONVERSION_COMPLETE
if (!embedded_text_preferences_callbacks_added) {
embedded_text_preferences_callbacks_added = TRUE;
eel_preferences_add_callback (NAUTILUS_PREFERENCES_DEFAULT_SMOOTH_FONT,
@ -2300,9 +2299,11 @@ embed_text (GdkPixbuf *pixbuf_without_text,
g_return_val_if_fail (EEL_IS_SMOOTH_TEXT_LAYOUT (smooth_text_layout), NULL);
eel_smooth_text_layout_set_line_spacing (smooth_text_layout, EMBEDDED_TEXT_LINE_SPACING);
eel_smooth_text_layout_set_empty_line_height (smooth_text_layout, EMBEDDED_TEXT_EMPTY_LINE_HEIGHT);
#endif
pixbuf_with_text = gdk_pixbuf_copy (pixbuf_without_text);
#if GNOME2_CONVERSION_COMPLETE
eel_smooth_text_layout_draw_to_pixbuf (smooth_text_layout,
pixbuf_with_text,
0,
@ -2314,6 +2315,7 @@ embed_text (GdkPixbuf *pixbuf_without_text,
EEL_OPACITY_FULLY_OPAQUE);
g_object_unref (smooth_text_layout);
#endif
return pixbuf_with_text;
}

View file

@ -169,10 +169,7 @@ struct NautilusIconContainerDetails {
/* fonts used to draw labels in regular mode */
GdkFont *label_font[NAUTILUS_ZOOM_LEVEL_LARGEST + 1];
/* font used to draw labels in smooth mode */
EelScalableFont *smooth_label_font;
int font_size_table[NAUTILUS_ZOOM_LEVEL_LARGEST + 1];
int font_size_table[NAUTILUS_ZOOM_LEVEL_LARGEST + 1]; /* unused? */
/* pixbuf and color for label highlighting */
GdkPixbuf *highlight_frame;

View file

@ -35,7 +35,6 @@
#include <eel/eel-gdk-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-label.h>
#include <libnautilus-private/nautilus-medusa-support.h>
#include <eel/eel-stock-dialogs.h>
@ -49,7 +48,7 @@
#define PROGRESS_UPDATE_INTERVAL 5000
typedef struct {
EelLabel *progress_label;
GtkLabel *progress_label;
GtkProgress *progress_bar;
} ProgressChangeData;
@ -91,7 +90,7 @@ get_text_for_progress_label (void)
static gboolean
update_progress_display (gpointer callback_data)
{
EelLabel *progress_label;
GtkLabel *progress_label;
ProgressChangeData *progress_change_data;
char *progress_string;

View file

@ -32,7 +32,6 @@
#include <eel/eel-gdk-pixbuf-extensions.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtkdrawingarea.h>
@ -210,29 +209,33 @@ nautilus_about_repaint (GtkWidget *widget,
/* utility routine to draw a string at a position */
static void
draw_aa_string (EelScalableFont *font,
GdkPixbuf *pixbuf,
draw_aa_string (GdkPixbuf *pixbuf,
gboolean bold,
int font_size,
int x_pos,
int y_pos,
guint color,
guint shadow_color,
guint32 color,
guint32 shadow_color,
const char *text,
int shadow_offset)
{
if (shadow_offset != 0) {
#if GNOME2_CONVERSION_COMPLETE
eel_scalable_font_draw_text (font, pixbuf,
x_pos + shadow_offset, y_pos + shadow_offset,
eel_gdk_pixbuf_whole_pixbuf,
font_size,
text, strlen (text),
shadow_color, EEL_OPACITY_FULLY_OPAQUE);
#endif
}
#if GNOME2_CONVERSION_COMPLETE
eel_scalable_font_draw_text (font, pixbuf, x_pos, y_pos,
eel_gdk_pixbuf_whole_pixbuf,
font_size,
text, strlen (text), color, EEL_OPACITY_FULLY_OPAQUE);
#endif
}
/* randomize_authors randomizes the order array so different names get displayed in different positions each time */
@ -269,8 +272,7 @@ randomize_authors (NautilusAbout *about)
/* draw the author list */
static void
draw_author_list (NautilusAbout *about,
GdkPixbuf *pixbuf,
EelScalableFont *plain_font)
GdkPixbuf *pixbuf)
{
int index, column_count;
int xpos, ypos;
@ -281,7 +283,7 @@ draw_author_list (NautilusAbout *about,
xpos = AUTHOR_LEFT_POS; ypos = AUTHOR_TOP_POS;
while (about->details->authors[about->details->order_array[index]] != NULL) {
draw_aa_string (plain_font, pixbuf, 12, xpos, ypos,
draw_aa_string (pixbuf, FALSE, 12, xpos, ypos,
EEL_RGB_COLOR_BLACK, EEL_RGB_COLOR_BLACK,
about->details->authors[about->details->order_array[index]],
0);
@ -313,15 +315,11 @@ nautilus_about_draw_info (NautilusAbout *about,
{
char *display_str, *temp_str;
char **comment_array;
EelScalableFont *plain_font, *bold_font;
GdkPixbuf *pixbuf;
uint black, white, grey;
int xpos, ypos, total_height;
int index;
plain_font = eel_scalable_font_get_default_font ();
bold_font = eel_scalable_font_make_bold (plain_font);
pixbuf = about->details->background_pixbuf;
total_height = gdk_pixbuf_get_height (pixbuf);
@ -331,17 +329,17 @@ nautilus_about_draw_info (NautilusAbout *about,
/* draw the name and version */
display_str = g_strdup_printf ("%s %s", title, version);
draw_aa_string (bold_font, pixbuf, 24, 12, 5, white, black, display_str, 1);
draw_aa_string (pixbuf, TRUE, 24, 12, 5, white, black, display_str, 1);
g_free (display_str);
/* draw the copyright notice */
draw_aa_string (bold_font, pixbuf, 11, 12, 40, black, black, copyright, 0);
draw_aa_string (pixbuf, TRUE, 11, 12, 40, black, black, copyright, 0);
/* draw the authors title */
draw_aa_string (bold_font, pixbuf, 20, 184, 64, black, black, _("Authors"), 0);
draw_aa_string (pixbuf, TRUE, 20, 184, 64, black, black, _("Authors"), 0);
/* draw the time stamp */
draw_aa_string (plain_font, pixbuf, 11, 284, total_height - 14, grey, black, time_stamp, 0);
draw_aa_string (pixbuf, FALSE, 11, 284, total_height - 14, grey, black, time_stamp, 0);
/* draw the translator's credit, if necessary */
if (eel_strcmp (translators, "Translator Credits") != 0) {
@ -356,7 +354,7 @@ nautilus_about_draw_info (NautilusAbout *about,
index = 0;
while (comment_array[index] != NULL) {
draw_aa_string (plain_font, pixbuf, 11, xpos, ypos, black, black, comment_array[index], 0);
draw_aa_string (pixbuf, FALSE, 11, xpos, ypos, black, black, comment_array[index], 0);
ypos += 14;
index++;
}
@ -371,7 +369,7 @@ nautilus_about_draw_info (NautilusAbout *about,
g_free (temp_str);
randomize_authors (about);
draw_author_list (about, pixbuf, plain_font);
draw_author_list (about, pixbuf);
about->details->last_update_time = time (NULL);
/* draw the comment, breaking it up into multiple lines */
@ -379,15 +377,11 @@ nautilus_about_draw_info (NautilusAbout *about,
index = 0;
xpos = 6; ypos = 118;
while (comment_array[index] != NULL) {
draw_aa_string (plain_font, pixbuf, 14, xpos, ypos, black, black, comment_array[index], 0);
draw_aa_string (pixbuf, FALSE, 14, xpos, ypos, black, black, comment_array[index], 0);
ypos += 18;
index++;
}
g_strfreev (comment_array);
/* release the fonts */
g_object_unref(plain_font);
g_object_unref(bold_font);
}
/* update authors is called to randomize the author array and redraw it */
@ -396,7 +390,6 @@ void
nautilus_about_update_authors (NautilusAbout *about)
{
ArtIRect author_area;
EelScalableFont *plain_font;
/* clear the author area */
author_area = eel_art_irect_assign (AUTHOR_LEFT_POS - 24,
@ -413,9 +406,7 @@ nautilus_about_update_authors (NautilusAbout *about)
randomize_authors (about);
/* redraw the authors */
plain_font = eel_scalable_font_get_default_font ();
draw_author_list (about, about->details->background_pixbuf, plain_font);
g_object_unref(plain_font);
draw_author_list (about, about->details->background_pixbuf);
about->details->last_update_time = time (NULL);

View file

@ -202,6 +202,8 @@ nautilus_component_adapter_factory_create_adapter (NautilusComponentAdapterFacto
nautilus_view = CORBA_OBJECT_NIL;
}
} else {
nautilus_view = CORBA_OBJECT_NIL;
#if 0
/* No View interface, we must adapt the object */
corba_factory = get_corba_factory (factory);
@ -211,6 +213,7 @@ nautilus_component_adapter_factory_create_adapter (NautilusComponentAdapterFacto
nautilus_view = CORBA_OBJECT_NIL;
}
bonobo_object_release_unref (corba_factory, NULL);
#endif
}
CORBA_exception_free (&ev);

View file

@ -42,7 +42,6 @@
#include <eel/eel-gtk-macros.h>
#include <eel/eel-image-table.h>
#include <eel/eel-image.h>
#include <eel/eel-label.h>
#include <eel/eel-labeled-image.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
@ -324,17 +323,21 @@ nautilus_property_browser_init (GtkObject *object)
gtk_container_add(GTK_CONTAINER(temp_frame), temp_hbox);
/* add the title label */
property_browser->details->title_label = eel_label_new ("");
property_browser->details->title_label = gtk_label_new ("");
#if GNOME2_CONVERSION_COMPLETE
eel_label_make_larger (EEL_LABEL (property_browser->details->title_label), 4);
eel_label_make_bold (EEL_LABEL (property_browser->details->title_label));
#endif
gtk_widget_show(property_browser->details->title_label);
gtk_box_pack_start (GTK_BOX(temp_hbox), property_browser->details->title_label, FALSE, FALSE, 8);
/* add the help label */
property_browser->details->help_label = eel_label_new ("");
property_browser->details->help_label = gtk_label_new ("");
gtk_widget_show(property_browser->details->help_label);
#if GNOME2_CONVERSION_COMPLETE
eel_label_make_smaller (EEL_LABEL (property_browser->details->help_label), 2);
#endif
gtk_box_pack_end (GTK_BOX(temp_hbox), property_browser->details->help_label, FALSE, FALSE, 8);
/* add the bottom box to hold the command buttons */
@ -1590,11 +1593,13 @@ labeled_image_configure (EelLabeledImage *labeled_image)
{
g_return_if_fail (EEL_IS_LABELED_IMAGE (labeled_image));
#if GNOME2_CONVERSION_COMPLETE
eel_labeled_image_set_background_mode (labeled_image,
EEL_SMOOTH_BACKGROUND_SOLID_COLOR);
EEL_SMOOTH_BACKGROUND_SOLID_COLOR);
eel_labeled_image_set_solid_background_color (labeled_image,
EEL_RGB_COLOR_WHITE);
EEL_RGB_COLOR_WHITE);
eel_labeled_image_set_spacing (labeled_image, LABELED_IMAGE_SPACING);
#endif
}
/* Make a color tile for a property */
@ -1608,10 +1613,12 @@ labeled_image_new (const char *text,
labeled_image = eel_labeled_image_new (text, pixbuf);
labeled_image_configure (EEL_LABELED_IMAGE (labeled_image));
#if GNOME2_CONVERSION_COMPLETE
if (num_smaller > 0) {
eel_labeled_image_make_smaller (EEL_LABELED_IMAGE (labeled_image),
num_smaller);
}
#endif
if (property_name != NULL) {
g_object_set_data_full (G_OBJECT (labeled_image),
@ -1837,7 +1844,7 @@ make_category(NautilusPropertyBrowser *property_browser, const char* path, const
{
/* set up the description in the help label */
eel_label_set_text (EEL_LABEL (property_browser->details->help_label), description);
gtk_label_set_text (GTK_LABEL (property_browser->details->help_label), description);
/* case out on the mode */
if (strcmp (mode, "directory") == 0)
@ -1864,8 +1871,10 @@ property_browser_category_button_new (const char *display_name,
button = eel_labeled_image_toggle_button_new_from_file_name (display_name,
file_name);
#if GNOME2_CONVERSION_COMPLETE
/* We want the label to never be smooth */
eel_labeled_image_set_label_never_smooth (EEL_LABELED_IMAGE (GTK_BIN (button)->child), TRUE);
#endif
/* We also want all of the buttons to be the same height */
eel_labeled_image_set_fixed_image_height (EEL_LABELED_IMAGE (GTK_BIN (button)->child), STANDARD_BUTTON_IMAGE_HEIGHT);
@ -2032,7 +2041,7 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
show_buttons = eel_preferences_get_boolean (NAUTILUS_PREFERENCES_CAN_ADD_CONTENT);
if (property_browser->details->category == NULL) {
eel_label_set_text(EEL_LABEL (property_browser->details->title_label), _("Select A Category:"));
gtk_label_set_text (GTK_LABEL (property_browser->details->title_label), _("Select A Category:"));
gtk_widget_hide(property_browser->details->add_button);
gtk_widget_hide(property_browser->details->remove_button);
@ -2104,7 +2113,7 @@ nautilus_property_browser_update_contents (NautilusPropertyBrowser *property_bro
}
if (label_text) {
eel_label_set_text (EEL_LABEL (property_browser->details->title_label), label_text);
gtk_label_set_text (GTK_LABEL (property_browser->details->title_label), label_text);
}
g_free(label_text);

View file

@ -33,7 +33,6 @@
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-label.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
#include <gtk/gtkframe.h>

View file

@ -37,7 +37,6 @@
#include <eel/eel-gnome-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-scalable-font.h>
#include <eel/eel-string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtkselection.h>
@ -72,9 +71,6 @@
#define TAB_ACTIVE_PRELIGHT_RIGHT 18
#define LAST_TAB_OFFSET 19
/* FIXME: Hard coded font size */
#define DEFAULT_FONT_SIZE 12
#define RIGHT_MARGIN_WIDTH 12
/* data structures */
@ -96,8 +92,6 @@ struct NautilusSidebarTabsDetails {
int total_height;
gboolean title_mode;
GdkRectangle title_rect;
EelScalableFont *tab_font;
int font_size;
GdkColor tab_color;
GdkColor background_color;
GdkColor line_color;
@ -140,7 +134,6 @@ static void draw_or_layout_all_tabs (NautilusSidebarTabs
gboolean layout_only);
static TabItem* tab_item_find_by_name (NautilusSidebarTabs *sidebar_tabs,
const char *name);
static void smooth_font_changed_callback (gpointer callback_data);
EEL_CLASS_BOILERPLATE (NautilusSidebarTabs, nautilus_sidebar_tabs, GTK_TYPE_WIDGET)
@ -239,6 +232,7 @@ nautilus_sidebar_tabs_load_theme_data (NautilusSidebarTabs *sidebar_tabs)
}
}
#if GNOME2_CONVERSION_COMPLETE
/* unload the old font if necessary */
if (sidebar_tabs->details->tab_font != NULL) {
g_object_unref (sidebar_tabs->details->tab_font);
@ -249,8 +243,11 @@ nautilus_sidebar_tabs_load_theme_data (NautilusSidebarTabs *sidebar_tabs)
/* FIXME: Hard coded font size */
sidebar_tabs->details->font_size = DEFAULT_FONT_SIZE;
#endif
}
#if GNOME2_CONVERSION_COMPLETE
/* Use the font from preferences */
static void
smooth_font_changed_callback (gpointer callback_data)
@ -273,6 +270,8 @@ smooth_font_changed_callback (gpointer callback_data)
gtk_widget_queue_resize (GTK_WIDGET (sidebar_tabs));
}
#endif
/* initialize a newly allocated sidebar tabs object */
static void
nautilus_sidebar_tabs_init (NautilusSidebarTabs *sidebar_tabs)
@ -309,9 +308,11 @@ nautilus_sidebar_tabs_init (NautilusSidebarTabs *sidebar_tabs)
eel_preferences_add_callback(NAUTILUS_PREFERENCES_THEME,
(EelPreferencesCallback) nautilus_sidebar_tabs_load_theme_data,
sidebar_tabs);
#if GNOME2_CONVERSION_COMPLETE
eel_preferences_add_callback (NAUTILUS_PREFERENCES_DEFAULT_SMOOTH_FONT,
smooth_font_changed_callback,
sidebar_tabs);
#endif
sidebar_tabs->details->title_prelit = FALSE;
}
@ -388,11 +389,6 @@ nautilus_sidebar_tabs_destroy (GtkObject *object)
nautilus_sidebar_tabs_unload_tab_pieces (sidebar_tabs);
}
if (sidebar_tabs->details->tab_font != NULL) {
g_object_unref (sidebar_tabs->details->tab_font);
sidebar_tabs->details->tab_font = NULL;
}
/* release the tab list, if any */
if (sidebar_tabs->details->tab_items) {
tab_items = sidebar_tabs->details->tab_items;
@ -406,9 +402,11 @@ nautilus_sidebar_tabs_destroy (GtkObject *object)
eel_preferences_remove_callback (NAUTILUS_PREFERENCES_THEME,
(EelPreferencesCallback) nautilus_sidebar_tabs_load_theme_data,
sidebar_tabs);
#if GNOME2_CONVERSION_COMPLETE
eel_preferences_remove_callback (NAUTILUS_PREFERENCES_DEFAULT_SMOOTH_FONT,
smooth_font_changed_callback,
sidebar_tabs);
#endif
g_free (sidebar_tabs->details);
sidebar_tabs->details = NULL;
@ -604,11 +602,12 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
int tab_bottom;
int tab_right;
int indicator_width;
EelDimensions name_dimensions;
PangoLayout *layout;
int total_width;
GtkWidget *widget;
GdkPixbuf *temp_pixbuf;
GdkColor *foreground_color;
int text_width, text_height;
g_assert (NAUTILUS_IS_SIDEBAR_TABS (sidebar_tabs));
@ -618,13 +617,12 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
indicator_width = 0;
}
/* measure the name and compute the bounding box */
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
sidebar_tabs->details->font_size,
tab_name,
strlen (tab_name));
total_width = name_dimensions.width + indicator_width + 2 * TAB_MARGIN;
layout = pango_layout_new (eel_gtk_widget_get_pango_ft2_context (GTK_WIDGET (sidebar_tabs)));
pango_layout_set_text (layout, tab_name, -1);
pango_layout_get_pixel_size (layout, &text_width, &text_height);
total_width = text_width + indicator_width + 2 * TAB_MARGIN;
widget = GTK_WIDGET (sidebar_tabs);
@ -659,7 +657,8 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
gdk_draw_line(widget->window, gc, x + 2, y + 2, x + 2, y + sidebar_tabs->details->tab_height - 1);
/* allocate the pixbuf and fill it with the background color */
temp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, name_dimensions.width + indicator_width + 1, name_dimensions.height + 1);
temp_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
text_width + indicator_width + 1, text_height + 1);
eel_gdk_pixbuf_fill_rectangle_with_color (temp_pixbuf,
eel_gdk_pixbuf_whole_pixbuf,
eel_gdk_color_to_rgb (foreground_color));
@ -670,21 +669,13 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
}
/* draw the name into the pixbuf using anti-aliased text */
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, temp_pixbuf,
1 + indicator_width, 1,
eel_gdk_pixbuf_whole_pixbuf,
sidebar_tabs->details->font_size,
tab_name, strlen (tab_name),
prelight_flag ? EEL_RGB_COLOR_WHITE : EEL_RGB_COLOR_BLACK,
EEL_OPACITY_FULLY_OPAQUE);
eel_gdk_pixbuf_draw_layout (temp_pixbuf, 1 + indicator_width, 1,
prelight_flag ? EEL_RGB_COLOR_WHITE : EEL_RGB_COLOR_BLACK,
layout);
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, temp_pixbuf,
indicator_width, 0,
eel_gdk_pixbuf_whole_pixbuf,
sidebar_tabs->details->font_size,
tab_name, strlen (tab_name),
prelight_flag ? EEL_RGB_COLOR_BLACK : EEL_RGB_COLOR_WHITE,
EEL_OPACITY_FULLY_OPAQUE);
eel_gdk_pixbuf_draw_layout (temp_pixbuf, indicator_width, 0,
prelight_flag ? EEL_RGB_COLOR_BLACK : EEL_RGB_COLOR_WHITE,
layout);
/* blit the pixbuf to the drawable, then release it */
@ -692,7 +683,7 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
widget->window,
0, 0,
x + TAB_MARGIN, y + 5,
name_dimensions.width + indicator_width + 1, name_dimensions.height + 1,
text_width + indicator_width + 1, text_height + 1,
GDK_PIXBUF_ALPHA_BILEVEL, 128,
GDK_RGB_DITHER_MAX,
0, 0);
@ -702,12 +693,14 @@ draw_one_tab_plain (NautilusSidebarTabs *sidebar_tabs, GdkGC *gc, char *tab_name
/* draw the bottom lines */
tab_bottom = y + sidebar_tabs->details->tab_height - 1;
gdk_gc_set_foreground (gc, &sidebar_tabs->details->line_color);
tab_right = x + 2*TAB_MARGIN + name_dimensions.width + indicator_width;
tab_right = x + 2*TAB_MARGIN + text_width + indicator_width;
gdk_gc_set_foreground (gc, &sidebar_tabs->details->line_color);
gdk_draw_line(widget->window, gc, tab_right, tab_bottom, widget->parent->allocation.width, tab_bottom);
gdk_draw_line(widget->window, gc, 0, tab_bottom, x, tab_bottom);
g_object_unref (layout);
return name_dimensions.width + indicator_width + 2 * TAB_MARGIN;
return text_width + indicator_width + 2 * TAB_MARGIN;
}
/* utility to draw a single tab piece into a pixbuf */
@ -775,14 +768,14 @@ draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, G
GdkRectangle *tab_rect)
{
GtkWidget *widget;
EelDimensions name_dimensions;
int piece_width, tab_width;
int piece_width, text_width;
int current_pos, right_edge_pos;
int text_x_pos, left_width;
int highlight_offset;
int text_x;
int text_y;
int indicator_width;
PangoLayout *layout;
if (indicator_pixbuf != NULL) {
indicator_width = gdk_pixbuf_get_width (indicator_pixbuf);
@ -802,10 +795,11 @@ draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, G
}
/* measure the size of the name */
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
sidebar_tabs->details->font_size,
tab_name,
strlen (tab_name));
layout = pango_layout_new (eel_gtk_widget_get_pango_ft2_context (GTK_WIDGET (sidebar_tabs)));
pango_layout_set_text (layout, tab_name, -1);
pango_layout_get_pixel_size (layout, &text_width, NULL);
/* draw the left edge piece */
current_pos = x - widget->allocation.x;
if (first_flag) {
@ -816,7 +810,7 @@ draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, G
/* draw the middle portion in a loop */
text_x_pos = current_pos;
right_edge_pos = current_pos + name_dimensions.width + indicator_width;
right_edge_pos = current_pos + text_width + indicator_width;
while (current_pos < right_edge_pos) {
piece_width = draw_tab_piece_aa (sidebar_tabs, tab_pixbuf, current_pos, y - widget->allocation.y,
right_edge_pos, TAB_NORMAL_FILL + highlight_offset);
@ -833,29 +827,19 @@ draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, G
/* make sure we can at least draw some of it */
if (text_x < gdk_pixbuf_get_width (tab_pixbuf)) {
if (indicator_pixbuf) {
pixbuf_composite (indicator_pixbuf, tab_pixbuf, text_x, text_y, 255);
text_x += indicator_width;
}
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, tab_pixbuf,
text_x, text_y,
eel_gdk_pixbuf_whole_pixbuf,
sidebar_tabs->details->font_size,
tab_name, strlen (tab_name),
EEL_RGB_COLOR_BLACK,
EEL_OPACITY_FULLY_OPAQUE);
text_x -= 1;
text_y -= 1;
eel_scalable_font_draw_text (sidebar_tabs->details->tab_font, tab_pixbuf,
text_x, text_y,
eel_gdk_pixbuf_whole_pixbuf,
sidebar_tabs->details->font_size,
tab_name, strlen (tab_name),
EEL_RGB_COLOR_WHITE,
EEL_OPACITY_FULLY_OPAQUE);
eel_gdk_pixbuf_draw_layout (tab_pixbuf, text_x, text_y,
EEL_RGB_COLOR_BLACK,
layout);
eel_gdk_pixbuf_draw_layout (tab_pixbuf, text_x - 1, text_y - 1,
EEL_RGB_COLOR_WHITE,
layout);
}
g_object_unref (layout);
/* set up the bounds rectangle for later hit-testing */
if (tab_rect) {
@ -866,8 +850,7 @@ draw_one_tab_themed (NautilusSidebarTabs *sidebar_tabs, GdkPixbuf *tab_pixbuf, G
}
/* return the total tab width */
tab_width = left_width + name_dimensions.width + indicator_width;
return tab_width;
return left_width + text_width + indicator_width;
}
static int
@ -891,8 +874,8 @@ get_text_offset (void)
static int
get_tab_width (NautilusSidebarTabs *sidebar_tabs, TabItem *this_tab, gboolean is_themed, gboolean first_flag)
{
int edge_width, indicator_width;
EelDimensions name_dimensions;
PangoLayout *layout;
int text_width, edge_width, indicator_width;
if (this_tab == NULL)
return 0;
@ -909,19 +892,15 @@ get_tab_width (NautilusSidebarTabs *sidebar_tabs, TabItem *this_tab, gboolean is
} else {
edge_width = 0;
}
name_dimensions = eel_scalable_font_measure_text (sidebar_tabs->details->tab_font,
sidebar_tabs->details->font_size,
this_tab->tab_text,
strlen (this_tab->tab_text));
} else {
edge_width = 2 * TAB_MARGIN;
#if GNOME2_CONVERSION_COMPLETE
name_dimensions.width = gdk_string_width (GTK_WIDGET (sidebar_tabs)->style->font, this_tab->tab_text);
#endif
}
return name_dimensions.width + edge_width + indicator_width;
}
layout = pango_layout_new (eel_gtk_widget_get_pango_ft2_context (GTK_WIDGET (sidebar_tabs)));
pango_layout_set_text (layout, this_tab->tab_text, -1);
pango_layout_get_pixel_size (layout, &text_width, NULL);
g_object_unref (layout);
return text_width + edge_width + indicator_width;
}
/* fill the canvas buffer with a tiled pixmap */
@ -1493,7 +1472,6 @@ nautilus_sidebar_tabs_add_view (NautilusSidebarTabs *sidebar_tabs, const char *n
new_tab_item = g_new0 (TabItem, 1);
new_tab_item->tab_text = g_strdup (name);
new_tab_item->visible = TRUE;
new_tab_item->prelit = FALSE;
new_tab_item->tab_view = new_view;
new_tab_item->notebook_page = page_num;

View file

@ -60,10 +60,6 @@
#include <math.h>
#include <string.h>
#if GNOME2_CONVERSION_COMPLETE
#include <eel/eel-label-with-background.h>
#endif
/* maximum allowable size to be displayed as the title */
#define MAX_TITLE_SIZE 256
#define MINIMUM_INFO_WIDTH 32
@ -233,11 +229,6 @@ nautilus_sidebar_title_init (NautilusSidebarTitle *sidebar_title)
gtk_widget_show (sidebar_title->details->emblem_box);
gtk_box_pack_start (GTK_BOX (sidebar_title), sidebar_title->details->emblem_box, 0, 0, 0);
/* FIXME: This should use EelLabel like the other displayed text.
* But I don't think this feature is ever used? Someone should consult
* with Andy about this. (This is not the same as the info in the Notes
* sidebar panel.)
*/
sidebar_title->details->notes = GTK_WIDGET (gtk_label_new (NULL));
gtk_label_set_line_wrap (GTK_LABEL (sidebar_title->details->notes), TRUE);
gtk_widget_show (sidebar_title->details->notes);

View file

@ -19,8 +19,6 @@
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-image-with-background.h>
#include <eel/eel-image.h>
#include <eel/eel-label-with-background.h>
#include <eel/eel-label.h>
#include <eel/eel-string-list.h>
#include <eel/eel-string.h>
#include <libnautilus-private/nautilus-file-utilities.h>