summaryrefslogtreecommitdiff
path: root/applets/notification_area/main.c
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-02-11 07:45:16 +0100
committerWolfgang Ulbrich <[email protected]>2016-02-12 07:04:31 +0100
commit9081a2ee5cb1e173bfbd191e9630b11be299d081 (patch)
treef72c024039d29871994d895280ef67a00b8a2a68 /applets/notification_area/main.c
parent9fbaadf2b1d3cbc1a3c752f099e10fde1e086b02 (diff)
downloadmate-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/main.c')
-rw-r--r--applets/notification_area/main.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/applets/notification_area/main.c b/applets/notification_area/main.c
index 3e8426ec..448f9e39 100644
--- a/applets/notification_area/main.c
+++ b/applets/notification_area/main.c
@@ -203,33 +203,15 @@ na_tray_applet_unrealize (GtkWidget *widget)
}
#if GTK_CHECK_VERSION (3, 0, 0)
-static inline gboolean
-style_context_lookup_color (GtkStyleContext *context,
- const gchar *color_name,
- GdkColor *color)
-{
- GdkRGBA rgba;
-
- if (!gtk_style_context_lookup_color (context, color_name, &rgba))
- return FALSE;
-
- color->red = rgba.red * 65535;
- color->green = rgba.green * 65535;
- color->blue = rgba.blue * 65535;
-
- return TRUE;
-}
-
static void
na_tray_applet_style_updated (GtkWidget *widget)
{
NaTrayApplet *applet = NA_TRAY_APPLET (widget);
GtkStyleContext *context;
- GdkRGBA rgba;
- GdkColor fg;
- GdkColor error;
- GdkColor warning;
- GdkColor success;
+ GdkRGBA fg;
+ GdkRGBA error;
+ GdkRGBA warning;
+ GdkRGBA success;
gint padding;
gint icon_size;
@@ -241,16 +223,13 @@ na_tray_applet_style_updated (GtkWidget *widget)
context = gtk_widget_get_style_context (widget);
- gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &rgba);
- fg.red = rgba.red * 65535;
- fg.green = rgba.green * 65535;
- fg.blue = rgba.blue * 65535;
+ gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &fg);
- if (!style_context_lookup_color (context, "error_color", &error))
+ if (!gtk_style_context_lookup_color (context, "error_color", &error))
error = fg;
- if (!style_context_lookup_color (context, "warning_color", &warning))
+ if (!gtk_style_context_lookup_color (context, "warning_color", &warning))
warning = fg;
- if (!style_context_lookup_color (context, "success_color", &success))
+ if (!gtk_style_context_lookup_color (context, "success_color", &success))
success = fg;
na_tray_set_colors (applet->priv->tray, &fg, &error, &warning, &success);