[gnome-control-center] Set border style of toolbars to none (plain).



commit 2abe2c2efc3bbdec0b828383471bbc6026253432
Author: Marek Kasik <mkasik redhat com>
Date:   Mon Dec 20 11:40:27 2010 +0100

    Set border style of toolbars to none (plain).

 panels/printers/cc-printers-panel.c |   40 +++++++++++++++++++++++++++++++++++
 panels/printers/printers.ui         |    6 ++--
 2 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 18c238d..ad9c289 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -916,6 +916,32 @@ allowed_user_remove_cb (GtkToolButton *toolbutton,
 }
 
 static void
+set_widget_style (GtkWidget *widget, gchar *style_data)
+{
+  GtkStyleProvider *provider;
+  GtkStyleContext  *context;
+
+  if (widget)
+    {
+      context = gtk_widget_get_style_context (widget);
+      provider = g_object_get_data (G_OBJECT (widget), "provider");
+
+      if (provider == NULL)
+        {
+          provider = (GtkStyleProvider *)gtk_css_provider_new ();
+          g_object_set_data (G_OBJECT (widget), "provider", provider);
+          gtk_style_context_add_provider (context,
+                                          GTK_STYLE_PROVIDER (provider),
+                                          GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+        }
+
+      gtk_css_provider_load_from_data ((GtkCssProvider *)provider,
+                                       style_data, -1, NULL);
+      gtk_style_context_invalidate (context);
+    }
+}
+
+static void
 cc_printers_panel_init (CcPrintersPanel *self)
 {
   CcPrintersPanelPrivate *priv;
@@ -985,6 +1011,20 @@ cc_printers_panel_init (CcPrintersPanel *self)
   g_signal_connect (widget, "clicked", G_CALLBACK (allowed_user_remove_cb), self);
 
 
+  /* set plain style for borders of toolbars */
+  widget = (GtkWidget*)
+    gtk_builder_get_object (priv->builder, "printers-toolbar");
+  set_widget_style (widget, "GtkToolbar { border-style: none }");
+
+  widget = (GtkWidget*)
+    gtk_builder_get_object (priv->builder, "jobs-toolbar");
+  set_widget_style (widget, "GtkToolbar { border-style: none }");
+
+  widget = (GtkWidget*)
+    gtk_builder_get_object (priv->builder, "allowed-users-toolbar");
+  set_widget_style (widget, "GtkToolbar { border-style: none }");
+
+
   /* make unused widgets insensitive for now */
   widget = (GtkWidget*)
     gtk_builder_get_object (priv->builder, "allowed-user-add-button");
diff --git a/panels/printers/printers.ui b/panels/printers/printers.ui
index ed91871..2c9ab60 100644
--- a/panels/printers/printers.ui
+++ b/panels/printers/printers.ui
@@ -28,7 +28,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkToolbar" id="toolbar1">
+              <object class="GtkToolbar" id="printers-toolbar">
                 <property name="visible">True</property>
                 <property name="toolbar_style">icons</property>
                 <child>
@@ -97,7 +97,7 @@
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkToolbar" id="toolbar">
+                      <object class="GtkToolbar" id="allowed-users-toolbar">
                         <property name="visible">True</property>
                         <child>
                           <object class="GtkToolButton" id="allowed-user-add-button">
@@ -330,7 +330,7 @@
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <child>
-              <object class="GtkToolbar" id="toolbar2">
+              <object class="GtkToolbar" id="jobs-toolbar">
                 <property name="visible">True</property>
                 <child>
                   <object class="GtkToolButton" id="job-cancel-button">



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