summaryrefslogtreecommitdiff
path: root/applets/clock/clock.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2015-08-30 00:47:17 -0400
committerraveit65 <[email protected]>2015-10-10 01:34:33 +0200
commitc71b55007d73485bfc3fc1d30c42cb329bc30125 (patch)
treecf02410b3691850ffd89b526aceb1bfb854d4fd3 /applets/clock/clock.c
parent8b3c651fbf92d3aa35b2e854aaa4468d43fccdf7 (diff)
downloadmate-panel-c71b55007d73485bfc3fc1d30c42cb329bc30125.tar.bz2
mate-panel-c71b55007d73485bfc3fc1d30c42cb329bc30125.tar.xz
clock-make transparent calendars possible
Add support for transparent calendar windows, the window background color can be set to any color and alpha value or made transparent with the #MatePanelPopupWindow named widget selector in the gtk theme. Defaults to theme background color if not set, same as before. This is used only for the calendar window right now
Diffstat (limited to 'applets/clock/clock.c')
-rw-r--r--applets/clock/clock.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index bcd89fc0..b68cce62 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -876,6 +876,17 @@ create_calendar (ClockData *cd)
G_CALLBACK (delete_event), cd->panel_button);
g_signal_connect (window, "key_press_event",
G_CALLBACK (close_on_escape), cd->panel_button);
+
+ /*Name this window so the default theme can be overridden in panel theme,
+ otherwise default GtkWindow bg will be pulled in and override transparency */
+ gtk_widget_set_name(window, "MatePanelPopupWindow");
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /* Make transparency possible in the theme */
+ GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(window));
+ GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
+ gtk_widget_set_visual(GTK_WIDGET(window), visual);
+#endif
return window;
}