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-07 13:30:56 +0200
commitb7d2033dff3f68d6ac67290c8b90203906e6762f (patch)
tree6833f3cdeb46951e3ec1ab558710f2e878130c22 /libmate-panel-applet/mate-panel-applet.c
parenta1445bc208e22260c27ce67ad4ebce6040ff5a3c (diff)
downloadmate-panel-b7d2033dff3f68d6ac67290c8b90203906e6762f.tar.bz2
mate-panel-b7d2033dff3f68d6ac67290c8b90203906e6762f.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 f036b6ec..a1cbc225 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -1533,6 +1533,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);
@@ -1553,6 +1555,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
@@ -1561,6 +1572,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);
@@ -1578,6 +1591,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