[gtk+/gtk-style-context: 355/540] GtkCssProvider: Also parse GdkColor values
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 355/540] GtkCssProvider: Also parse GdkColor values
- Date: Fri, 3 Dec 2010 03:05:59 +0000 (UTC)
commit bc10495624e577091db84bf7069db11822befee5
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 20803a2..d41df05 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 (&color, value_str) == TRUE)
+ if (type == GDK_TYPE_RGBA &&
+ gdk_rgba_parse (&color, value_str))
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]