[network-manager-applet: 4/6] applet: use GtkCheckMenuItem for the VPN menu



commit 5455c67d58820b1050fff5dc31e5bbf89c92d769
Author: Pavel Šimerda <psimerda redhat com>
Date:   Tue Feb 17 15:25:13 2015 +0100

    applet: use GtkCheckMenuItem for the VPN menu
    
    Without this patch the VPN items won't display correctly in appindicator
    mode.

 src/applet.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index d4a1458..2b42002 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -1785,8 +1785,7 @@ nma_menu_add_vpn_submenu (GtkWidget *menu, NMApplet *applet)
 
                name = get_connection_id (connection);
 
-               item = GTK_MENU_ITEM (gtk_image_menu_item_new_with_label (name));
-               gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(item), TRUE);
+               item = GTK_MENU_ITEM (gtk_check_menu_item_new_with_label (name));
 
                /* If no VPN connections are active, draw all menu items enabled. If
                 * >= 1 VPN connections are active, only the active VPN menu item is
@@ -1804,11 +1803,7 @@ nma_menu_add_vpn_submenu (GtkWidget *menu, NMApplet *applet)
                else
                        gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
 
-               if (active) {
-                       GtkWidget *image = gtk_image_new_from_stock (GTK_STOCK_CONNECT, GTK_ICON_SIZE_MENU);
-
-                       gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-               }
+               gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), !!active);
 
                g_object_set_data_full (G_OBJECT (item), "connection", 
                                                    g_object_ref (connection),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]