summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-04-05 02:06:43 +0200
committerPablo Barciela <[email protected]>2018-04-07 23:18:29 +0200
commitb70d39475d747b9299985ad8009f80b299e3a3e8 (patch)
treea0b47b80659048f96a75c3c37d23d8937b7ccbc1 /eel
parenta00bad28d88e1af9f8290192ec90287a42f736ef (diff)
downloadcaja-b70d39475d747b9299985ad8009f80b299e3a3e8.tar.bz2
caja-b70d39475d747b9299985ad8009f80b299e3a3e8.tar.xz
caja-spatial-window.c: avoid deprecated GtkImageMenuItem
avoid deprecated: gtk_image_menu_item_set_always_show_image gtk_image_menu_item_new_with_label gtk_image_menu_item_set_image
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-gtk-extensions.c24
-rw-r--r--eel/eel-gtk-extensions.h3
2 files changed, 27 insertions, 0 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index ede45cfe..e08a9e12 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -494,3 +494,27 @@ eel_image_menu_item_new_from_icon (const gchar *icon_name,
return menuitem;
}
+
+GtkWidget *
+eel_image_menu_item_new_from_pixbuf (GdkPixbuf *icon_pixbuf,
+ const gchar *label_name)
+{
+ GtkWidget *icon;
+ GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+
+ if (icon_pixbuf)
+ icon = gtk_image_new_from_pixbuf (icon_pixbuf);
+ else
+ icon = gtk_image_new ();
+
+ GtkWidget *label_menu = gtk_label_new (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;
+}
diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h
index 8c39a4c7..b2086e4e 100644
--- a/eel/eel-gtk-extensions.h
+++ b/eel/eel-gtk-extensions.h
@@ -75,4 +75,7 @@ void eel_gtk_message_dialog_set_details_label (GtkMessag
GtkWidget * eel_image_menu_item_new_from_icon (const gchar *icon_name,
const gchar *label_name);
+GtkWidget * eel_image_menu_item_new_from_pixbuf (GdkPixbuf *icon_pixbuf,
+ const gchar *label_name);
+
#endif /* EEL_GTK_EXTENSIONS_H */