Commit 2abe2c2e authored by Marek Kašík's avatar Marek Kašík

Set border style of toolbars to none (plain).

parent 8c4511b5
......@@ -915,6 +915,32 @@ allowed_user_remove_cb (GtkToolButton *toolbutton,
return;
}
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)
{
......@@ -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");
......
......@@ -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">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment