Skip to content


eel-gtk-extensions: show icons in right-click menus only if "menus-ha…
Browse files Browse the repository at this point in the history
…ve-icons" set
  • Loading branch information
lukefromdc committed Jun 21, 2018
1 parent b15c076 commit 76c2a2a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions eel/eel-gtk-extensions.c
Expand Up @@ -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);
/*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);


return menuitem;

Expand Down

0 comments on commit 76c2a2a

Please sign in to comment.