summaryrefslogtreecommitdiff
path: root/applets/notification_area/main.c
diff options
context:
space:
mode:
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);