diff options
Diffstat (limited to 'lib/egg')
-rw-r--r-- | lib/egg/egg-toolbar-editor.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index 746810707..a74cbf94a 100644 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -454,16 +454,27 @@ editor_create_item_from_name (EggToolbarEditor *editor, GValue value = { 0, }; GtkAction *action; GtkWidget *icon; + gboolean is_named = FALSE; action = find_action (editor, name); g_return_val_if_fail (action != NULL, NULL); g_value_init (&value, G_TYPE_STRING); - g_object_get_property (G_OBJECT (action), "stock_id", &value); + g_object_get_property (G_OBJECT (action), "icon-name", &value); stock_id = g_value_get_string (&value); + if (!stock_id) { + /* Gtk{Radio,Toggle}Actions only set either of the properties */ + g_value_reset (&value); + g_object_get_property (G_OBJECT (action), "stock-id", &value); + stock_id = g_value_get_string (&value); + is_named = FALSE; + } else { + is_named = TRUE; + } + /* This is a workaround to catch named icons. */ - if (stock_id && gtk_icon_theme_has_icon (gtk_icon_theme_get_default(), stock_id)) + if (is_named) icon = gtk_image_new_from_icon_name (stock_id, GTK_ICON_SIZE_LARGE_TOOLBAR); else |