[Xfce4-commits] [panel-plugins/xfce4-systemload-plugin] 15/16: Handroll our own GtkImageMenuItem replacement, not perfect but works

noreply at xfce.org noreply at xfce.org
Fri Apr 29 16:07:32 CEST 2016


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository panel-plugins/xfce4-systemload-plugin.

commit 18f6294c9ed8c0207d8c318c9d1688cbb5a63c74
Author: Landry Breuil <landry at xfce.org>
Date:   Fri Apr 29 14:05:42 2016 +0200

    Handroll our own GtkImageMenuItem replacement, not perfect but works
---
 panel-plugin/systemload.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/systemload.c b/panel-plugin/systemload.c
index f273a79..0382f0a 100644
--- a/panel-plugin/systemload.c
+++ b/panel-plugin/systemload.c
@@ -313,6 +313,7 @@ monitor_control_new(XfcePanelPlugin *plugin)
     int count;
     t_global_monitor *global;
     GtkWidget* image;
+    GtkWidget *label, *box;
     
     global = g_new(t_global_monitor, 1);
 #ifdef HAVE_UPOWER_GLIB
@@ -330,11 +331,15 @@ monitor_control_new(XfcePanelPlugin *plugin)
     global->command.enabled = FALSE;
     global->command.command_text = g_strdup(DEFAULT_COMMAND_TEXT);
 
-    global->menu_item = gtk_image_menu_item_new_with_mnemonic(
-                            _("Run _System Monitor"));
+    box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+    label = gtk_label_new_with_mnemonic (_("Run _System Monitor"));
+    global->menu_item = gtk_menu_item_new();
     image = gtk_image_new_from_icon_name("utilities-system-monitor",
                                                     GTK_ICON_SIZE_MENU);
-	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(global->menu_item), image);
+    gtk_container_add (GTK_CONTAINER (box), image);
+    gtk_container_add (GTK_CONTAINER (box), label);
+    gtk_container_add (GTK_CONTAINER (global->menu_item), box);
+    gtk_widget_show_all (global->menu_item);
 
     xfce_panel_plugin_add_action_widget (plugin, global->ebox);
     

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list