[gtk+/gtk-style-context] GtkCssProvider: Also parse GdkColor values
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context] GtkCssProvider: Also parse GdkColor values
- Date: Sat, 13 Nov 2010 20:21:46 +0000 (UTC)
commit 48f38a9a4205763e3814705c7eeaba086764b2dd
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Nov 13 01:24:07 2010 +0100
GtkCssProvider: Also parse GdkColor values
This is necessary for widget style properties to work.
gtk/gtkcssprovider.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index c644cca..e180ee6 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2313,12 +2313,18 @@ css_provider_parse_value (GtkCssProvider *css_provider,
type = G_VALUE_TYPE (value);
- if (type == GDK_TYPE_RGBA)
+ if (type == GDK_TYPE_RGBA ||
+ type == GDK_TYPE_COLOR)
{
GdkRGBA color;
+ GdkColor rgb;
- if (gdk_rgba_parse (value_str, &color) == TRUE)
+ if (type == GDK_TYPE_RGBA &&
+ gdk_rgba_parse (value_str, &color))
g_value_set_boxed (value, &color);
+ else if (type == GDK_TYPE_COLOR &&
+ gdk_color_parse (value_str, &rgb))
+ g_value_set_boxed (value, &rgb);
else
{
GtkSymbolicColor *symbolic_color;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]