summaryrefslogtreecommitdiff
path: root/pluma/pluma-utils.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-04-20 01:25:13 +0200
committerPablo Barciela <[email protected]>2018-04-20 01:25:13 +0200
commit7c692bd51aa1b5cf670625936c28fed187184c4c (patch)
treed1ad0e73f5d86136d919f138c8f17af993f7cf71 /pluma/pluma-utils.c
parent6ab83502622938048e7cf3b783beb1c618861819 (diff)
downloadpluma-7c692bd51aa1b5cf670625936c28fed187184c4c.tar.bz2
pluma-7c692bd51aa1b5cf670625936c28fed187184c4c.tar.xz
pluma-file-browser-widget.c: avoid deprecated GtkImageMenuItem
avoid deprecated: gtk_image_menu_item_new_with_label gtk_image_menu_item_set_image
Diffstat (limited to 'pluma/pluma-utils.c')
-rw-r--r--pluma/pluma-utils.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c
index 35136c3c..e8fa3f55 100644
--- a/pluma/pluma-utils.c
+++ b/pluma/pluma-utils.c
@@ -1698,3 +1698,27 @@ free_resources:
g_regex_unref (regex);
return found;
}
+
+GtkWidget *
+pluma_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;
+}