[gnome-control-center] networking: set mnemonic widget for labels and values in connection details



commit b5d03b42a043ab81c46b0f22fe14fa51893e86bf
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Fri Dec 6 14:45:34 2013 +0100

    networking: set mnemonic widget for labels and values in connection details
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719986

 panels/network/net-device-ethernet.c |   27 +++++++++++++++------------
 panels/network/net-device-simple.c   |    1 +
 panels/network/net-virtual-device.c  |    1 +
 3 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/panels/network/net-device-ethernet.c b/panels/network/net-device-ethernet.c
index a2450f0..a2a699f 100644
--- a/panels/network/net-device-ethernet.c
+++ b/panels/network/net-device-ethernet.c
@@ -71,22 +71,25 @@ device_ethernet_add_to_notebook (NetObject    *object,
 static void
 add_details_row (GtkWidget *details, gint top, const gchar *heading, const gchar *value)
 {
-        GtkWidget *label;
+        GtkWidget *heading_label;
+        GtkWidget *value_label;
 
-        label = gtk_label_new (heading);
-        gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
-        gtk_widget_set_halign (label, GTK_ALIGN_END);
-        gtk_widget_set_hexpand (label, TRUE);
-        gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
+        heading_label = gtk_label_new (heading);
+        gtk_style_context_add_class (gtk_widget_get_style_context (heading_label), "dim-label");
+        gtk_widget_set_halign (heading_label, GTK_ALIGN_END);
+        gtk_widget_set_hexpand (heading_label, TRUE);
+        gtk_misc_set_alignment (GTK_MISC (heading_label), 1, 0.5);
 
-        gtk_grid_attach (GTK_GRID (details), label, 0, top, 1, 1);
+        gtk_grid_attach (GTK_GRID (details), heading_label, 0, top, 1, 1);
 
-        label = gtk_label_new (value);
-        gtk_widget_set_halign (label, GTK_ALIGN_START);
-        gtk_widget_set_hexpand (label, TRUE);
-        gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+        value_label = gtk_label_new (value);
+        gtk_widget_set_halign (value_label, GTK_ALIGN_START);
+        gtk_widget_set_hexpand (value_label, TRUE);
+        gtk_misc_set_alignment (GTK_MISC (value_label), 0, 0.5);
 
-        gtk_grid_attach (GTK_GRID (details), label, 1, top, 1, 1);
+        gtk_label_set_mnemonic_widget(heading_label, value_label);
+
+        gtk_grid_attach (GTK_GRID (details), value_label, 1, top, 1, 1);
 }
 
 static gchar *
diff --git a/panels/network/net-device-simple.c b/panels/network/net-device-simple.c
index 6c366b2..14adedd 100644
--- a/panels/network/net-device-simple.c
+++ b/panels/network/net-device-simple.c
@@ -296,6 +296,7 @@ net_device_simple_add_row (NetDeviceSimple *device_simple,
         value = gtk_label_new (NULL);
         gtk_misc_set_alignment (GTK_MISC (value), 0.0, 0.5);
         g_object_bind_property (device_simple, property_name, value, "label", 0);
+        gtk_label_set_mnemonic_widget(label, value);
         gtk_grid_attach (grid, value, 1, top_attach, 1, 1);
         gtk_widget_show (value);
 }
diff --git a/panels/network/net-virtual-device.c b/panels/network/net-virtual-device.c
index b41629b..2e63eb0 100644
--- a/panels/network/net-virtual-device.c
+++ b/panels/network/net-virtual-device.c
@@ -468,6 +468,7 @@ net_virtual_device_add_row (NetVirtualDevice *virtual_device,
         value = gtk_label_new (NULL);
         gtk_misc_set_alignment (GTK_MISC (value), 0.0, 0.5);
         g_object_bind_property (virtual_device, property_name, value, "label", 0);
+        gtk_label_set_mnemonic_widget(label, value);
         gtk_grid_attach (grid, value, 1, top_attach, 1, 1);
         gtk_widget_show (value);
 }


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