tray-manager: Don't use GdkColor
It has been deprecated for a while in favor of GdkRgba, though in our case translating ClutterColors to an intermediate color type before setting _NET_SYSTEM_TRAY_COLORS is a bit silly, so just move to ClutterColor as the rest of the code base.
This commit is contained in:
parent
c164a8fe03
commit
ccf1bd9f27
@ -117,7 +117,7 @@ PKG_CHECK_MODULES(GNOME_SHELL_JS, gio-2.0 gjs-internals-1.0 >= $GJS_MIN_VERSION)
|
|||||||
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.8 x11)
|
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-3.0 libcroco-0.6 >= 0.6.8 x11)
|
||||||
PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0)
|
PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0)
|
||||||
PKG_CHECK_MODULES(SHELL_HOTPLUG_SNIFFER, gio-2.0 gdk-pixbuf-2.0)
|
PKG_CHECK_MODULES(SHELL_HOTPLUG_SNIFFER, gio-2.0 gdk-pixbuf-2.0)
|
||||||
PKG_CHECK_MODULES(TRAY, gtk+-3.0)
|
PKG_CHECK_MODULES(TRAY, clutter-1.0 gtk+-3.0)
|
||||||
PKG_CHECK_MODULES(GVC, libpulse >= $PULSE_MIN_VERS libpulse-mainloop-glib gobject-2.0)
|
PKG_CHECK_MODULES(GVC, libpulse >= $PULSE_MIN_VERS libpulse-mainloop-glib gobject-2.0)
|
||||||
PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.13.1)
|
PKG_CHECK_MODULES(DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.13.1)
|
||||||
|
|
||||||
|
@ -200,27 +200,12 @@ shell_tray_manager_style_changed (StWidget *theme_widget,
|
|||||||
ShellTrayManager *manager = user_data;
|
ShellTrayManager *manager = user_data;
|
||||||
StThemeNode *theme_node;
|
StThemeNode *theme_node;
|
||||||
StIconColors *icon_colors;
|
StIconColors *icon_colors;
|
||||||
GdkColor foreground, warning, error, success;
|
|
||||||
|
|
||||||
theme_node = st_widget_get_theme_node (theme_widget);
|
theme_node = st_widget_get_theme_node (theme_widget);
|
||||||
icon_colors = st_theme_node_get_icon_colors (theme_node);
|
icon_colors = st_theme_node_get_icon_colors (theme_node);
|
||||||
|
|
||||||
foreground.red = icon_colors->foreground.red * 0x101;
|
|
||||||
foreground.green = icon_colors->foreground.green * 0x101;
|
|
||||||
foreground.blue = icon_colors->foreground.blue * 0x101;
|
|
||||||
warning.red = icon_colors->warning.red * 0x101;
|
|
||||||
warning.green = icon_colors->warning.green * 0x101;
|
|
||||||
warning.blue = icon_colors->warning.blue * 0x101;
|
|
||||||
error.red = icon_colors->error.red * 0x101;
|
|
||||||
error.green = icon_colors->error.green * 0x101;
|
|
||||||
error.blue = icon_colors->error.blue * 0x101;
|
|
||||||
success.red = icon_colors->success.red * 0x101;
|
|
||||||
success.green = icon_colors->success.green * 0x101;
|
|
||||||
success.blue = icon_colors->success.blue * 0x101;
|
|
||||||
|
|
||||||
na_tray_manager_set_colors (manager->priv->na_manager,
|
na_tray_manager_set_colors (manager->priv->na_manager,
|
||||||
&foreground, &warning,
|
&icon_colors->foreground, &icon_colors->warning,
|
||||||
&error, &success);
|
&icon_colors->error, &icon_colors->success);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -97,16 +97,16 @@ na_tray_manager_init (NaTrayManager *manager)
|
|||||||
manager->fg.green = 0;
|
manager->fg.green = 0;
|
||||||
manager->fg.blue = 0;
|
manager->fg.blue = 0;
|
||||||
|
|
||||||
manager->error.red = 0xffff;
|
manager->error.red = 0xff;
|
||||||
manager->error.green = 0;
|
manager->error.green = 0;
|
||||||
manager->error.blue = 0;
|
manager->error.blue = 0;
|
||||||
|
|
||||||
manager->warning.red = 0xffff;
|
manager->warning.red = 0xff;
|
||||||
manager->warning.green = 0xffff;
|
manager->warning.green = 0xff;
|
||||||
manager->warning.blue = 0;
|
manager->warning.blue = 0;
|
||||||
|
|
||||||
manager->success.red = 0;
|
manager->success.red = 0;
|
||||||
manager->success.green = 0xffff;
|
manager->success.green = 0xff;
|
||||||
manager->success.blue = 0;
|
manager->success.blue = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,18 +658,18 @@ na_tray_manager_set_colors_property (NaTrayManager *manager)
|
|||||||
atom = gdk_x11_get_xatom_by_name_for_display (display,
|
atom = gdk_x11_get_xatom_by_name_for_display (display,
|
||||||
"_NET_SYSTEM_TRAY_COLORS");
|
"_NET_SYSTEM_TRAY_COLORS");
|
||||||
|
|
||||||
data[0] = manager->fg.red;
|
data[0] = manager->fg.red * 0x101;
|
||||||
data[1] = manager->fg.green;
|
data[1] = manager->fg.green * 0x101;
|
||||||
data[2] = manager->fg.blue;
|
data[2] = manager->fg.blue * 0x101;
|
||||||
data[3] = manager->error.red;
|
data[3] = manager->error.red * 0x101;
|
||||||
data[4] = manager->error.green;
|
data[4] = manager->error.green * 0x101;
|
||||||
data[5] = manager->error.blue;
|
data[5] = manager->error.blue * 0x101;
|
||||||
data[6] = manager->warning.red;
|
data[6] = manager->warning.red * 0x101;
|
||||||
data[7] = manager->warning.green;
|
data[7] = manager->warning.green * 0x101;
|
||||||
data[8] = manager->warning.blue;
|
data[8] = manager->warning.blue * 0x101;
|
||||||
data[9] = manager->success.red;
|
data[9] = manager->success.red * 0x101;
|
||||||
data[10] = manager->success.green;
|
data[10] = manager->success.green * 0x101;
|
||||||
data[11] = manager->success.blue;
|
data[11] = manager->success.blue * 0x101;
|
||||||
|
|
||||||
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
|
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||||
GDK_WINDOW_XID (window),
|
GDK_WINDOW_XID (window),
|
||||||
@ -862,17 +862,17 @@ na_tray_manager_set_orientation (NaTrayManager *manager,
|
|||||||
|
|
||||||
void
|
void
|
||||||
na_tray_manager_set_colors (NaTrayManager *manager,
|
na_tray_manager_set_colors (NaTrayManager *manager,
|
||||||
GdkColor *fg,
|
ClutterColor *fg,
|
||||||
GdkColor *error,
|
ClutterColor *error,
|
||||||
GdkColor *warning,
|
ClutterColor *warning,
|
||||||
GdkColor *success)
|
ClutterColor *success)
|
||||||
{
|
{
|
||||||
g_return_if_fail (NA_IS_TRAY_MANAGER (manager));
|
g_return_if_fail (NA_IS_TRAY_MANAGER (manager));
|
||||||
|
|
||||||
if (!gdk_color_equal (&manager->fg, fg) ||
|
if (!clutter_color_equal (&manager->fg, fg) ||
|
||||||
!gdk_color_equal (&manager->error, error) ||
|
!clutter_color_equal (&manager->error, error) ||
|
||||||
!gdk_color_equal (&manager->warning, warning) ||
|
!clutter_color_equal (&manager->warning, warning) ||
|
||||||
!gdk_color_equal (&manager->success, success))
|
!clutter_color_equal (&manager->success, success))
|
||||||
{
|
{
|
||||||
manager->fg = *fg;
|
manager->fg = *fg;
|
||||||
manager->error = *error;
|
manager->error = *error;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
#endif
|
#endif
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
#include <clutter/clutter.h>
|
||||||
|
|
||||||
#include "na-tray-child.h"
|
#include "na-tray-child.h"
|
||||||
|
|
||||||
@ -54,10 +55,10 @@ struct _NaTrayManager
|
|||||||
GtkWidget *invisible;
|
GtkWidget *invisible;
|
||||||
GdkScreen *screen;
|
GdkScreen *screen;
|
||||||
GtkOrientation orientation;
|
GtkOrientation orientation;
|
||||||
GdkColor fg;
|
ClutterColor fg;
|
||||||
GdkColor error;
|
ClutterColor error;
|
||||||
GdkColor warning;
|
ClutterColor warning;
|
||||||
GdkColor success;
|
ClutterColor success;
|
||||||
|
|
||||||
GList *messages;
|
GList *messages;
|
||||||
GHashTable *socket_table;
|
GHashTable *socket_table;
|
||||||
@ -95,10 +96,10 @@ void na_tray_manager_set_orientation (NaTrayManager *manager,
|
|||||||
GtkOrientation orientation);
|
GtkOrientation orientation);
|
||||||
GtkOrientation na_tray_manager_get_orientation (NaTrayManager *manager);
|
GtkOrientation na_tray_manager_get_orientation (NaTrayManager *manager);
|
||||||
void na_tray_manager_set_colors (NaTrayManager *manager,
|
void na_tray_manager_set_colors (NaTrayManager *manager,
|
||||||
GdkColor *fg,
|
ClutterColor *fg,
|
||||||
GdkColor *error,
|
ClutterColor *error,
|
||||||
GdkColor *warning,
|
ClutterColor *warning,
|
||||||
GdkColor *success);
|
ClutterColor *success);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
Loading…
Reference in New Issue
Block a user