summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet.c
diff options
context:
space:
mode:
authorBalló György <[email protected]>2015-11-20 01:14:25 +0100
committerBalló György <[email protected]>2015-11-20 01:14:25 +0100
commit6f634c680fbc5ee5051253554f2710e39f9ea80a (patch)
tree39e608c46aacfd05dbd7a1a4a7ce7a32eac8681d /libmate-panel-applet/mate-panel-applet.c
parent22f1787182a46bc7583be4bb07eb7e0f91c60b65 (diff)
downloadmate-panel-6f634c680fbc5ee5051253554f2710e39f9ea80a.tar.bz2
mate-panel-6f634c680fbc5ee5051253554f2710e39f9ea80a.tar.xz
Don't set the panel transparent by default
This fixes the background for GTK+ 3 themes which don't support mate-panel explicitly. Themes could still overwrite the background if they want in the usual way.
Diffstat (limited to 'libmate-panel-applet/mate-panel-applet.c')
-rw-r--r--libmate-panel-applet/mate-panel-applet.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index 260ef2bb..57520218 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -1979,34 +1979,40 @@ mate_panel_applet_setup (MatePanelApplet *applet)
void _mate_panel_applet_apply_css(GtkWidget* widget, MatePanelAppletBackgroundType type)
{
GtkStyleContext* context;
- GtkCssProvider *provider;
context = gtk_widget_get_style_context (widget);
- gtk_widget_reset_style(widget);
+ gtk_widget_reset_style (widget);
switch (type) {
case PANEL_NO_BACKGROUND:
- gtk_style_context_remove_class(context,"mate-custom-panel-background");
+ gtk_style_context_remove_class (context, "mate-custom-panel-background");
break;
case PANEL_COLOR_BACKGROUND:
case PANEL_PIXMAP_BACKGROUND:
- provider = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (provider,
- ".mate-custom-panel-background{\n"
- " background-color: rgba (0, 0, 0, 0);\n"
- " background-image: none;\n"
- "}",
- -1, NULL);
gtk_style_context_add_class (context, "mate-custom-panel-background");
- gtk_style_context_add_provider (context,
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
break;
default:
g_assert_not_reached ();
break;
}
}
+
+void _mate_panel_applet_prepare_css (GtkStyleContext *context)
+{
+ GtkCssProvider *provider;
+
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ ".mate-custom-panel-background{\n"
+ " background-color: rgba (0, 0, 0, 0);\n"
+ " background-image: none;\n"
+ "}",
+ -1, NULL);
+ gtk_style_context_add_provider (context,
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+}
#endif
static void
@@ -2045,10 +2051,10 @@ mate_panel_applet_init (MatePanelApplet *applet)
gtk_widget_set_visual(GTK_WIDGET(applet->priv->plug), visual);
GtkStyleContext *context;
context = gtk_widget_get_style_context (GTK_WIDGET(applet->priv->plug));
- gtk_style_context_remove_class (context,GTK_STYLE_CLASS_BACKGROUND);
gtk_style_context_add_class(context,"gnome-panel-menu-bar");
gtk_style_context_add_class(context,"mate-panel-menu-bar");
gtk_widget_set_name(GTK_WIDGET(applet->priv->plug), "PanelPlug");
+ _mate_panel_applet_prepare_css(context);
#endif
g_signal_connect_swapped (G_OBJECT (applet->priv->plug), "embedded",
G_CALLBACK (mate_panel_applet_setup),