[gnome-control-center] network: Follow through on the original design



commit 0622883025d411f5e38a95f5799fde853bc83360
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 5 15:48:23 2015 -0500

    network: Follow through on the original design
    
    GTK+ can now do circular buttons with ease, so make
    this page a little more fancy by following the original
    design.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745703

 panels/network/cc-network-panel.c |    9 +++++++++
 panels/network/net-device-wifi.c  |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index cd8385e..e5b6a01 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -1373,6 +1373,7 @@ cc_network_panel_init (CcNetworkPanel *panel)
         GtkWidget *widget;
         GtkWidget *toplevel;
         GDBusConnection *system_bus;
+        GtkCssProvider *provider;
 
         panel->priv = NETWORK_PANEL_PRIVATE (panel);
         g_resources_register (cc_network_get_resource ());
@@ -1476,4 +1477,12 @@ cc_network_panel_init (CcNetworkPanel *panel)
         widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
                                                      "vbox1"));
         gtk_container_add (GTK_CONTAINER (panel), widget);
+
+        provider = gtk_css_provider_new ();
+        gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 
20px; }", -1, NULL);
+        gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+                                                   GTK_STYLE_PROVIDER (provider),
+                                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+        g_object_unref (provider);
+
 }
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index 6af02ad..017ba96 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -1590,6 +1590,7 @@ make_row (GtkSizeGroup   *rows,
         gtk_widget_show (image);
         widget = gtk_button_new ();
         gtk_style_context_add_class (gtk_widget_get_style_context (widget), "image-button");
+        gtk_style_context_add_class (gtk_widget_get_style_context (widget), "circular-button");
         gtk_widget_show (widget);
         gtk_container_add (GTK_CONTAINER (widget), image);
         gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);


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