summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-07-06 00:21:09 -0400
committerraveit65 <[email protected]>2017-07-18 07:43:30 +0200
commit45e518dcdaaf6aa39e3ac60157e68e40aa385bca (patch)
tree77ff2e5db65bbbddbdc92e0fd404468b338d5a36 /libmate-panel-applet/mate-panel-applet.c
parent480a2adcfb35e9f66ca42e1567bc15ea46da7a05 (diff)
downloadmate-panel-45e518dcdaaf6aa39e3ac60157e68e40aa385bca.tar.bz2
mate-panel-45e518dcdaaf6aa39e3ac60157e68e40aa385bca.tar.xz
Fix GTK theme image bg support on vertical panel
Themers can use the .vertical and .horizontal style classes to rotate a background on vertical panels the same way scrollbars are themed. Apply these style classes to PanelPlugs too so this can actually be used.
Diffstat (limited to 'libmate-panel-applet/mate-panel-applet.c')
-rw-r--r--libmate-panel-applet/mate-panel-applet.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index da800862..3bbaab82 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -1535,6 +1535,8 @@ mate_panel_applet_change_background(MatePanelApplet *applet,
GdkRGBA* color,
cairo_pattern_t *pattern)
{
+ GtkStyleContext* context;
+ MatePanelAppletOrient orientation;
GdkWindow* window = gtk_widget_get_window (applet->priv->plug);
gtk_widget_set_app_paintable(GTK_WIDGET(applet),TRUE);
_mate_panel_applet_apply_css(GTK_WIDGET(applet->priv->plug),type);
@@ -1555,6 +1557,15 @@ mate_panel_applet_change_background(MatePanelApplet *applet,
g_assert_not_reached ();
break;
}
+ context = gtk_widget_get_style_context (GTK_WIDGET(applet->priv->plug));
+ orientation = mate_panel_applet_get_orient (applet);
+ if (applet->priv->orient == MATE_PANEL_APPLET_ORIENT_UP ||
+ applet->priv->orient == MATE_PANEL_APPLET_ORIENT_DOWN){
+ gtk_style_context_add_class(context,"horizontal");
+ }
+ else {
+ gtk_style_context_add_class(context,"vertical");
+ }
}
#else
static void
@@ -1563,6 +1574,8 @@ mate_panel_applet_change_background(MatePanelApplet *applet,
GdkRGBA* color,
cairo_pattern_t *pattern)
{
+ GtkStyleContext* context;
+ MatePanelAppletOrient orientation;
GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(applet));
gtk_widget_set_app_paintable(GTK_WIDGET(applet),TRUE);
_mate_panel_applet_apply_css(GTK_WIDGET(applet->priv->plug),type);
@@ -1580,6 +1593,15 @@ mate_panel_applet_change_background(MatePanelApplet *applet,
g_assert_not_reached ();
break;
}
+ context = gtk_widget_get_style_context (GTK_WIDGET(applet->priv->plug));
+ orientation = mate_panel_applet_get_orient (applet);
+ if (applet->priv->orient == MATE_PANEL_APPLET_ORIENT_UP ||
+ applet->priv->orient == MATE_PANEL_APPLET_ORIENT_DOWN){
+ gtk_style_context_add_class(context,"horizontal");
+ }
+ else {
+ gtk_style_context_add_class(context,"vertical");
+ }
}
#endif