diff options
author | lukefromdc <[email protected]> | 2018-06-21 00:40:04 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-06-21 17:03:20 -0400 |
commit | 76c2a2a9cbfeff0c4a58bfef2cd509f04d7e3440 (patch) | |
tree | bf41aafd2926c520dd50507a69aa50d9a04a5954 | |
parent | b15c076e3dbe1c6d4a78a570570a444cfb2f9cf5 (diff) | |
download | caja-76c2a2a9cbfeff0c4a58bfef2cd509f04d7e3440.tar.bz2 caja-76c2a2a9cbfeff0c4a58bfef2cd509f04d7e3440.tar.xz |
eel-gtk-extensions: show icons in right-click menus only if "menus-have-icons" set
-rw-r--r-- | eel/eel-gtk-extensions.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c index 9b50e42e..02898b82 100644 --- a/eel/eel-gtk-extensions.c +++ b/eel/eel-gtk-extensions.c @@ -449,22 +449,29 @@ eel_image_menu_item_new_from_icon (const gchar *icon_name, const gchar *label_name) { GtkWidget *icon; + GSettings *icon_settings; GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - if (icon_name) + icon_settings = g_settings_new ("org.mate.interface"); + if ((icon_name) && (g_settings_get_boolean (icon_settings, "menus-have-icons"))) + /*Load the icon if user has icons in menus turned on*/ icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); else + /*Load an empty icon to hold the space*/ icon = gtk_image_new (); GtkWidget *label_menu = gtk_label_new_with_mnemonic (g_strconcat (label_name, " ", NULL)); GtkWidget *menuitem = gtk_menu_item_new (); - + gtk_container_add (GTK_CONTAINER (box), icon); + gtk_container_add (GTK_CONTAINER (box), label_menu); gtk_container_add (GTK_CONTAINER (menuitem), box); gtk_widget_show_all (menuitem); + g_object_unref(icon_settings); + return menuitem; } |