summaryrefslogtreecommitdiff
path: root/libmate-panel-applet
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-06-28 01:14:26 -0400
committerraveit65 <[email protected]>2017-07-18 07:42:39 +0200
commit480a2adcfb35e9f66ca42e1567bc15ea46da7a05 (patch)
treed041fec02d863d83567f868043f716d3e0cbc99e /libmate-panel-applet
parent735849425569b80477963fae7f4184cd41cf96c7 (diff)
downloadmate-panel-480a2adcfb35e9f66ca42e1567bc15ea46da7a05.tar.bz2
mate-panel-480a2adcfb35e9f66ca42e1567bc15ea46da7a05.tar.xz
Make panel image background in GTK theme work again
*Support both url(image file) and gradient image panel backgrounds in the GTK theme. *Scaling by 1.0/panel dimensions should never have worked, doesn't now. Get the actual image dimensions instead *Background: disable in PanelPlug features that don't work on panel toplevel *panel-background: catch error on unsupported image such as -gtk-gradient An image bg set in the GTK theme needs to be a file or a css gradient as the older -gtk-gradient does not return a valid cairo_pattern_t when read directly *GTK 3.14,3.16: fix theme bg image render in plugs PanelPlug rendering is handled differently with GTK 3.14 and 3.16 than later versions. Handle this so all supported image backgrounds in GTK themes render properly in all supported GTK versions
Diffstat (limited to 'libmate-panel-applet')
-rw-r--r--libmate-panel-applet/mate-panel-applet.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index e726dfb4..da800862 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -1778,18 +1778,30 @@ static void _mate_panel_applet_prepare_css (GtkStyleContext *context)
GtkCssProvider *provider;
provider = gtk_css_provider_new ();
+#if GTK_CHECK_VERSION (3, 18, 0)
gtk_css_provider_load_from_data (provider,
- ".mate-custom-panel-background{\n"
+ "#PanelPlug {\n"
+ " background-repeat: no-repeat;\n" /*disable in gtk theme features */
+ " background-size: cover; " /*that don't work on panel-toplevel */
+ " }\n"
+ ".mate-custom-panel-background{\n" /*prepare CSS for user set theme */
+ " background-color: rgba (0, 0, 0, 0);\n"
+ " background-image: none;\n"
+ "}",
+ -1, NULL);
+#else
+gtk_css_provider_load_from_data (provider,
+ ".mate-custom-panel-background{\n" /*prepare CSS for user set theme */
" background-color: rgba (0, 0, 0, 0);\n"
" background-image: none;\n"
"}",
-1, NULL);
+#endif
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (provider);
}
-
static void
mate_panel_applet_init (MatePanelApplet *applet)
{