[Xfce4-commits] [apps/xfce4-taskmanager] 03/11: Add proper color-setting for the labels in Gtk3

noreply at xfce.org noreply at xfce.org
Fri Dec 19 12:44:49 CET 2014


This is an automated email from the git hooks/post-receive script.

peter pushed a commit to branch master
in repository apps/xfce4-taskmanager.

commit 2ccd5469ad789144c7786e31427a8be996da8bc1
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Dec 19 11:28:47 2014 +0100

    Add proper color-setting for the labels in Gtk3
---
 src/process-statusbar.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/process-statusbar.c b/src/process-statusbar.c
index 0299d26..c9e343f 100644
--- a/src/process-statusbar.c
+++ b/src/process-statusbar.c
@@ -133,7 +133,11 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
 	XtmProcessStatusbar *statusbar = XTM_PROCESS_STATUSBAR (object);
 	gchar *text;
 	gchar *float_value;
+#ifdef HAVE_GTK3
+	GdkRGBA color;
+#else
 	GdkColor color;
+#endif
 
 	switch (property_id)
 	{
@@ -142,8 +146,13 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
 		float_value = rounded_float_value (statusbar->cpu, statusbar->settings);
 		text = g_strdup_printf (_("CPU: %s%%"), float_value);
 		gtk_label_set_text (GTK_LABEL (statusbar->label_cpu), text);
+#ifdef HAVE_GTK3
+		gdk_rgba_parse (&color, "#ff6e00");
+		gtk_widget_override_color (statusbar->label_cpu, GTK_STATE_NORMAL, &color);
+#else
 		gdk_color_parse ("#ff6e00", &color);
 		gtk_widget_modify_fg (statusbar->label_cpu, GTK_STATE_NORMAL, &color);
+#endif
 		g_free (float_value);
 		g_free (text);
 		break;
@@ -152,8 +161,13 @@ xtm_process_statusbar_set_property (GObject *object, guint property_id, const GV
 		g_strlcpy(statusbar->memory, g_value_get_string (value), 64);
 		text = g_strdup_printf (_("Memory: %s"), statusbar->memory);
 		gtk_label_set_text (GTK_LABEL (statusbar->label_memory), text);
+#ifdef HAVE_GTK3
+		gdk_rgba_parse (&color, "#ab1852");
+		gtk_widget_override_color (statusbar->label_cpu, GTK_STATE_NORMAL, &color);
+#else
 		gdk_color_parse ("#ab1852", &color);
 		gtk_widget_modify_fg (statusbar->label_memory, GTK_STATE_NORMAL, &color);
+#endif
 		g_free (text);
 		break;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list