aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-08-19 00:18:42 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-19 00:18:42 +0800
commit4187293731274274e4283d9039f6e30c95578118 (patch)
treeab8ce6e6bc9316846097b827157e0f664cf57634 /widgets
parent28b28bf057056d2aa28458b322319bf679608ae5 (diff)
downloadgsoc2013-evolution-4187293731274274e4283d9039f6e30c95578118.tar.gz
gsoc2013-evolution-4187293731274274e4283d9039f6e30c95578118.tar.zst
gsoc2013-evolution-4187293731274274e4283d9039f6e30c95578118.zip
Merge revisions 35993:36015 from trunk.
Adapt recent "crash recovery" changes to new architecture. svn path=/branches/kill-bonobo/; revision=36018
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-online-button.c20
2 files changed, 20 insertions, 8 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 15f82821c4..7f8567f96b 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,5 +1,13 @@
2008-08-14 Matthew Barnes <mbarnes@redhat.com>
+ ** 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 <mbarnes@redhat.com>
+
* e-multi-config-dialog.c:
* e-send-options.c:
Use e_display_help() for displaying help.
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 <glib/gi18n.h>
-#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");
}