[gtk+/gtk-style-context: 112/206] GtkCssProvider: Allow symbolic colors when parsing style rules.



commit 2ddf8e3ed190e3728a01f3eed92a6c5c82d98294
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 25 20:31:08 2010 +0200

    GtkCssProvider: Allow symbolic colors when parsing style rules.

 gtk/gtkcssprovider.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 5a8ba4e..587acdd 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1185,10 +1185,21 @@ css_provider_parse_value (const gchar *value_str,
     {
       GdkColor color;
 
-      if (gdk_color_parse (value_str, &color) == FALSE)
-        return FALSE;
+      if (gdk_color_parse (value_str, &color) == TRUE)
+        g_value_set_boxed (value, &color);
+      else
+        {
+          GtkSymbolicColor *symbolic_color;
 
-      g_value_set_boxed (value, &color);
+          symbolic_color = symbolic_color_parse (value_str);
+
+          if (!symbolic_color)
+            return FALSE;
+
+          g_value_unset (value);
+          g_value_init (value, GTK_TYPE_SYMBOLIC_COLOR);
+          g_value_take_boxed (value, symbolic_color);
+        }
     }
   else if (type == PANGO_TYPE_FONT_DESCRIPTION)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]