From 35198c83c81acec8826ff65e0a53963d387aacb2 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Tue, 13 Oct 2015 23:30:38 -0400 Subject: 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. --- applets/brightness/brightness-applet.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 } /** -- cgit v1.2.1