diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/egg/egg-toolbar-editor.c | 26 |
2 files changed, 31 insertions, 1 deletions
@@ -1,3 +1,9 @@ +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. + 2007-06-24 Felix Riemann <friemann@svn.gnome.org> * lib/egg/egg-toolbar-editor.c: (editor_create_item_from_name): 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) { |