diff options
author | Felix Riemann <friemann@svn.gnome.org> | 2007-06-25 22:41:06 +0800 |
---|---|---|
committer | Felix Riemann <friemann@src.gnome.org> | 2007-06-25 22:41:06 +0800 |
commit | 07d195c96103ab490f97f5bf914c9f6e6a748612 (patch) | |
tree | 3471e25b991df22d8a272b2f9418134f2e72cd17 /lib | |
parent | eff03238a993ff0af0d79f8abb5dbae7f02e1c75 (diff) | |
download | gsoc2013-epiphany-07d195c96103ab490f97f5bf914c9f6e6a748612.tar.gz gsoc2013-epiphany-07d195c96103ab490f97f5bf914c9f6e6a748612.tar.zst gsoc2013-epiphany-07d195c96103ab490f97f5bf914c9f6e6a748612.zip |
Make named drag-icons toolbar-sized like the others. Part of bug #450590.
2007-06-25 Felix Riemann <friemann@svn.gnome.org>
* lib/egg/egg-toolbar-editor.c: (event_box_realize_cb):
Make named drag-icons toolbar-sized like the others.
Part of bug #450590.
svn path=/trunk/; revision=7096
Diffstat (limited to 'lib')
-rw-r--r-- | lib/egg/egg-toolbar-editor.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index b08a97b26..5660408a2 100644 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -362,6 +362,7 @@ event_box_realize_cb (GtkWidget *widget, GtkImage *icon) { gchar *stock_id; GdkPixbuf *pixbuf; + gtk_image_get_stock (icon, &stock_id, NULL); pixbuf = gtk_widget_render_icon (widget, stock_id, GTK_ICON_SIZE_LARGE_TOOLBAR, NULL); @@ -371,9 +372,32 @@ event_box_realize_cb (GtkWidget *widget, GtkImage *icon) else if (type == GTK_IMAGE_ICON_NAME) { const gchar *icon_name; + GdkScreen *screen; + GtkIconTheme *icon_theme; + GtkSettings *settings; + gint width, height; + GdkPixbuf *pixbuf; gtk_image_get_icon_name (icon, &icon_name, NULL); - gtk_drag_source_set_icon_name (widget, icon_name); + screen = gtk_widget_get_screen (widget); + icon_theme = gtk_icon_theme_get_for_screen (screen); + settings = gtk_settings_get_for_screen (screen); + + if (!gtk_icon_size_lookup_for_settings (settings, + GTK_ICON_SIZE_LARGE_TOOLBAR, + &width, &height)) + { + width = height = 24; + } + + pixbuf = gtk_icon_theme_load_icon (icon_theme, icon_name, + MIN (width, height), 0, NULL); + if (G_UNLIKELY (!pixbuf)) + return; + + gtk_drag_source_set_icon_pixbuf (widget, pixbuf); + g_object_unref (pixbuf); + } else if (type == GTK_IMAGE_PIXBUF) { |