summaryrefslogtreecommitdiff
path: root/eel/eel-gtk-extensions.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-03-27 00:15:43 +0200
committerPablo Barciela <[email protected]>2018-03-27 00:36:00 +0200
commit8bebf06d8dc992bd32b0da29cd7c676cd1a245c9 (patch)
tree3cce5909a19373f855ba7edca21f650d443dec67 /eel/eel-gtk-extensions.c
parentffc91064319f535eb530f7dbd0d5a5e880716f87 (diff)
downloadcaja-8bebf06d8dc992bd32b0da29cd7c676cd1a245c9.tar.bz2
caja-8bebf06d8dc992bd32b0da29cd7c676cd1a245c9.tar.xz
rename 'mate_image_menu_item...' to 'eel_image_menu_item_new_from_icon'
Diffstat (limited to 'eel/eel-gtk-extensions.c')
-rw-r--r--eel/eel-gtk-extensions.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index c3cff2f5..21366fb4 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -456,3 +456,27 @@ eel_gtk_message_dialog_set_details_label (GtkMessageDialog *dialog,
gtk_widget_show (label);
gtk_widget_show (expander);
}
+
+GtkWidget *
+eel_image_menu_item_new_from_icon (const gchar *icon_name,
+ const gchar *label_name)
+{
+ GtkWidget *icon;
+ GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+
+ if (icon_name)
+ icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+ else
+ 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;
+}