diff options
author | Wolfgang Ulbrich <[email protected]> | 2016-02-11 07:45:16 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2016-02-12 07:04:31 +0100 |
commit | 9081a2ee5cb1e173bfbd191e9630b11be299d081 (patch) | |
tree | f72c024039d29871994d895280ef67a00b8a2a68 /applets/notification_area/na-tray-manager.c | |
parent | 9fbaadf2b1d3cbc1a3c752f099e10fde1e086b02 (diff) | |
download | mate-panel-9081a2ee5cb1e173bfbd191e9630b11be299d081.tar.bz2 mate-panel-9081a2ee5cb1e173bfbd191e9630b11be299d081.tar.xz |
GTK+3 notification-area: don't use deprecated GdkColor
Taken from:
https://git.gnome.org/browse/gnome-panel/commit/?id=d1dd54e
Diffstat (limited to 'applets/notification_area/na-tray-manager.c')
-rw-r--r-- | applets/notification_area/na-tray-manager.c | 51 |
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; |