summaryrefslogtreecommitdiff
path: root/mate-panel/libpanel-util
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-04-19 12:06:40 +0200
committerPablo Barciela <[email protected]>2018-04-19 12:06:40 +0200
commit86701517e7d7cb3d2c08a40d76af97308f18902c (patch)
treefd5800f952972d73284a8a67094af85f7b2f8a65 /mate-panel/libpanel-util
parent49a3b4a3a5f233d99aa1ee42b0ea3241cc23a038 (diff)
downloadmate-panel-86701517e7d7cb3d2c08a40d76af97308f18902c.tar.bz2
mate-panel-86701517e7d7cb3d2c08a40d76af97308f18902c.tar.xz
panel-context-menu.c: avoid deprecated GtkImageMenuItem
avoid deprecated: gtk_image_menu_item_new_with_mnemonic gtk_image_menu_item_set_image
Diffstat (limited to 'mate-panel/libpanel-util')
-rw-r--r--mate-panel/libpanel-util/panel-gtk.c24
-rw-r--r--mate-panel/libpanel-util/panel-gtk.h3
2 files changed, 27 insertions, 0 deletions
diff --git a/mate-panel/libpanel-util/panel-gtk.c b/mate-panel/libpanel-util/panel-gtk.c
index 11a7a952..ce6705c4 100644
--- a/mate-panel/libpanel-util/panel-gtk.c
+++ b/mate-panel/libpanel-util/panel-gtk.c
@@ -159,3 +159,27 @@ panel_file_chooser_dialog_new (const gchar *title,
return result;
}
+
+GtkWidget *
+panel_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;
+}
diff --git a/mate-panel/libpanel-util/panel-gtk.h b/mate-panel/libpanel-util/panel-gtk.h
index 078dcb05..80188aed 100644
--- a/mate-panel/libpanel-util/panel-gtk.h
+++ b/mate-panel/libpanel-util/panel-gtk.h
@@ -46,6 +46,9 @@ GtkWidget* panel_file_chooser_dialog_new (const gchar *title,
const gchar *first_button_text,
...);
+GtkWidget* panel_image_menu_item_new_from_icon (const gchar *icon_name,
+ const gchar *label_name);
+
#ifdef __cplusplus
}
#endif