diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2016-06-02 13:07:39 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2016-06-03 08:50:31 +0300 |
commit | cd4d5a2e0cb5e65389e4b12b3ba79645e236a825 (patch) | |
tree | a0aafb430c438266723a466ac49d4ecbda842cec /garcon-gtk | |
parent | 22dd867d7d0c87d7386c565aa1158d48b5442422 (diff) | |
download | garcon-cd4d5a2e0cb5e65389e4b12b3ba79645e236a825.tar.gz |
Desktop actions custom icon support
The FDO spec allows for actions in the desktop file to supply
a custom icon to use. This patch adds that support into the
GarconMenuItemAction as well as to garcon-gtk.
Diffstat (limited to 'garcon-gtk')
-rw-r--r-- | garcon-gtk/garcon-gtk-menu.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/garcon-gtk/garcon-gtk-menu.c b/garcon-gtk/garcon-gtk-menu.c index 2b59e42..32b1887 100644 --- a/garcon-gtk/garcon-gtk-menu.c +++ b/garcon-gtk/garcon-gtk-menu.c @@ -686,13 +686,23 @@ garcon_gtk_menu_add_actions (GarconGtkMenu *menu, for (iter = g_list_first(actions); iter != NULL; iter = g_list_next (iter)) { GarconMenuItemAction *action = garcon_menu_item_get_action (menu_item, iter->data); + const gchar *action_icon_name; if (action == NULL) continue; + /* If there's a custom icon associated with the action, use it. + * Otherwise default to the parent's icon. + */ + action_icon_name = garcon_menu_item_action_get_icon_name (action); + if (action_icon_name == NULL) + { + action_icon_name = parent_icon_name; + } + mi = garcon_gtk_menu_create_menu_item (menu, garcon_menu_item_action_get_name (action), - parent_icon_name); + action_icon_name); gtk_menu_shell_append (GTK_MENU_SHELL (submenu), mi); g_signal_connect (G_OBJECT (mi), "activate", |