From 31ab3e7713d0613e6bd1cbb1610fed82cc53ddb8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 14 Aug 2008 20:37:38 +0000 Subject: ** Fixes bug #547411 2008-08-14 Matthew Barnes ** Fixes bug #547411 * data/icons/hicolor_status_32x32_online.png: * data/icons/hicolor_status_32x32_online.svg: * data/icons/hicolor_status_32x32_offline.png: * data/icons/hicolor_status_32x32_offline.svg: New, Tangoized versions of the old "art" images. * art/online.png: * art/offline.png: These are now obsolete. Remove them. * widgets/misc/e-online-button.c (e_online_button_set_online): The button icons are themed now but still oblong. Load the icons by filename so GTK+ doesn't scale them. svn path=/trunk/; revision=35995 --- widgets/misc/ChangeLog | 8 ++++++++ widgets/misc/e-online-button.c | 20 ++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'widgets/misc') diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 15f82821c4..7f8567f96b 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,11 @@ +2008-08-14 Matthew Barnes + + ** Fixes part of bug #547411 + + * e-online-button.c (e_online_button_set_online): + The button icons are themed now but still oblong. + Load the icons by filename so GTK+ doesn't scale them. + 2008-08-14 Matthew Barnes * e-multi-config-dialog.c: diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c index 7391384950..346aec2857 100644 --- a/widgets/misc/e-online-button.c +++ b/widgets/misc/e-online-button.c @@ -22,9 +22,6 @@ #include -#define ONLINE_IMAGE "online.png" -#define OFFLINE_IMAGE "offline.png" - #define E_ONLINE_BUTTON_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate)) @@ -177,18 +174,25 @@ e_online_button_set_online (EOnlineButton *button, gboolean online) { GtkImage *image; - gchar *filename; - const gchar *image_name; + GtkIconInfo *icon_info; + GtkIconTheme *icon_theme; + const gchar *filename; + const gchar *icon_name; g_return_if_fail (E_IS_ONLINE_BUTTON (button)); button->priv->online = online; - image_name = online ? ONLINE_IMAGE : OFFLINE_IMAGE; image = GTK_IMAGE (button->priv->image); - filename = g_build_filename (EVOLUTION_IMAGES, image_name, NULL); + icon_name = online ? "online" : "offline"; + icon_theme = gtk_icon_theme_get_default (); + + /* Prevent GTK+ from scaling these rectangular icons. */ + icon_info = gtk_icon_theme_lookup_icon ( + icon_theme, icon_name, GTK_ICON_SIZE_BUTTON, 0); + filename = gtk_icon_info_get_filename (icon_info); gtk_image_set_from_file (image, filename); - g_free (filename); + gtk_icon_info_free (icon_info); g_object_notify (G_OBJECT (button), "online"); } -- cgit v1.2.3