summaryrefslogtreecommitdiff
path: root/applets/brightness/brightness-applet.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2015-10-13 23:30:38 -0400
committerraveit65 <[email protected]>2015-10-14 21:51:58 +0200
commit35198c83c81acec8826ff65e0a53963d387aacb2 (patch)
tree9130ca0250e9cacc572abbd144ba6b671db60f80 /applets/brightness/brightness-applet.c
parent92bdf80b0c3a7b73ba4d807f777ae41f6f215bcc (diff)
downloadmate-power-manager-35198c83c81acec8826ff65e0a53963d387aacb2.tar.bz2
mate-power-manager-35198c83c81acec8826ff65e0a53963d387aacb2.tar.xz
brightness: follow custom volume control themes
follow custom volume control themes. Brightness slider a near match for volume control slider by using same .mate-panel-applet-slider selector as in mate-media. One difference is that this slider is drawn in a single frame, volume control slider is in a frame within a frame. Therefore this one is drawn slightly narrower.
Diffstat (limited to 'applets/brightness/brightness-applet.c')
-rw-r--r--applets/brightness/brightness-applet.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/applets/brightness/brightness-applet.c b/applets/brightness/brightness-applet.c
index 7dafcd0..8930551 100644
--- a/applets/brightness/brightness-applet.c
+++ b/applets/brightness/brightness-applet.c
@@ -703,6 +703,19 @@ gpm_applet_create_popup (GpmBrightnessApplet *applet)
g_signal_connect (G_OBJECT(applet->popup), "key-press-event",
G_CALLBACK(gpm_applet_key_press_cb), applet);
#endif
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /* Set volume control frame, slider and toplevel window to follow panel volume control theme */
+ GtkWidget *toplevel = gtk_widget_get_toplevel (frame);
+ GtkStyleContext *context;
+ context = gtk_widget_get_style_context (GTK_WIDGET(toplevel));
+ gtk_style_context_remove_class (context,GTK_STYLE_CLASS_BACKGROUND);
+ gtk_style_context_add_class(context,"mate-panel-applet-slider");
+ /*Make transparency possible in gtk3 theme3 */
+ GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
+ GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
+ gtk_widget_set_visual(GTK_WIDGET(toplevel), visual);
+#endif
}
/**