summaryrefslogtreecommitdiff
path: root/applets/notification_area/na-tray-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'applets/notification_area/na-tray-manager.c')
-rw-r--r--applets/notification_area/na-tray-manager.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/applets/notification_area/na-tray-manager.c b/applets/notification_area/na-tray-manager.c
index 76caa979..aaea0908 100644
--- a/applets/notification_area/na-tray-manager.c
+++ b/applets/notification_area/na-tray-manager.c
@@ -97,6 +97,27 @@ na_tray_manager_init (NaTrayManager *manager)
manager->padding = 0;
manager->icon_size = 0;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ manager->fg.red = 0.0;
+ manager->fg.green = 0.0;
+ manager->fg.blue = 0.0;
+ manager->fg.alpha = 1.0;
+
+ manager->error.red = 1.0;
+ manager->error.green = 0.0;
+ manager->error.blue = 0.0;
+ manager->error.alpha = 1.0;
+
+ manager->warning.red = 1.0;
+ manager->warning.green = 1.0;
+ manager->warning.blue = 0.0;
+ manager->warning.alpha = 1.0;
+
+ manager->success.red = 0.0;
+ manager->success.green = 1.0;
+ manager->success.blue = 0.0;
+ manager->success.alpha = 1.0;
+#else
manager->fg.red = 0;
manager->fg.green = 0;
manager->fg.blue = 0;
@@ -112,6 +133,7 @@ na_tray_manager_init (NaTrayManager *manager)
manager->success.red = 0;
manager->success.green = 0xffff;
manager->success.blue = 0;
+#endif
}
static void
@@ -788,6 +810,20 @@ na_tray_manager_set_colors_property (NaTrayManager *manager)
atom = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_SYSTEM_TRAY_COLORS");
+#if GTK_CHECK_VERSION (3, 0, 0)
+ data[0] = manager->fg.red * 65535;
+ data[1] = manager->fg.green * 65535;
+ data[2] = manager->fg.blue * 65535;
+ data[3] = manager->error.red * 65535;
+ data[4] = manager->error.green * 65535;
+ data[5] = manager->error.blue * 65535;
+ data[6] = manager->warning.red * 65535;
+ data[7] = manager->warning.green * 65535;
+ data[8] = manager->warning.blue * 65535;
+ data[9] = manager->success.red * 65535;
+ data[10] = manager->success.green * 65535;
+ data[11] = manager->success.blue * 65535;
+#else
data[0] = manager->fg.red;
data[1] = manager->fg.green;
data[2] = manager->fg.blue;
@@ -800,6 +836,7 @@ na_tray_manager_set_colors_property (NaTrayManager *manager)
data[9] = manager->success.red;
data[10] = manager->success.green;
data[11] = manager->success.blue;
+#endif
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
@@ -1037,6 +1074,19 @@ na_tray_manager_set_icon_size (NaTrayManager *manager,
void
na_tray_manager_set_colors (NaTrayManager *manager,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA *fg,
+ GdkRGBA *error,
+ GdkRGBA *warning,
+ GdkRGBA *success)
+{
+ g_return_if_fail (NA_IS_TRAY_MANAGER (manager));
+
+ if (!gdk_rgba_equal (&manager->fg, fg) ||
+ !gdk_rgba_equal (&manager->error, error) ||
+ !gdk_rgba_equal (&manager->warning, warning) ||
+ !gdk_rgba_equal (&manager->success, success))
+#else
GdkColor *fg,
GdkColor *error,
GdkColor *warning,
@@ -1048,6 +1098,7 @@ na_tray_manager_set_colors (NaTrayManager *manager,
!gdk_color_equal (&manager->error, error) ||
!gdk_color_equal (&manager->warning, warning) ||
!gdk_color_equal (&manager->success, success))
+#endif
{
manager->fg = *fg;
manager->error = *error;