[gtk+/wip/css: 60/125] css: 'transparent' is a valid color everywhere
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/css: 60/125] css: 'transparent' is a valid color everywhere
- Date: Tue, 3 Jan 2012 04:15:46 +0000 (UTC)
commit 265342d76e5c1a95f4f3b4d8687ae5e864883ce4
Author: Benjamin Otte <otte redhat com>
Date: Sat Dec 31 23:20:44 2011 +0100
css: 'transparent' is a valid color everywhere
gtk/gtkcssparser.c | 7 +++++++
gtk/gtkstyleproperty.c | 27 +++++----------------------
2 files changed, 12 insertions(+), 22 deletions(-)
---
diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c
index 27ea511..8867e04 100644
--- a/gtk/gtkcssparser.c
+++ b/gtk/gtkcssparser.c
@@ -831,6 +831,13 @@ _gtk_css_parser_read_symbolic_color (GtkCssParser *parser)
g_return_val_if_fail (GTK_IS_CSS_PARSER (parser), NULL);
+ if (_gtk_css_parser_try (parser, "transparent", TRUE))
+ {
+ GdkRGBA transparent = { 0, 0, 0, 0 };
+
+ return gtk_symbolic_color_new_literal (&transparent);
+ }
+
if (_gtk_css_parser_try (parser, "@", FALSE))
{
name = _gtk_css_parser_try_name (parser, TRUE);
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index 0354650..a464840 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -1593,23 +1593,6 @@ border_corner_radius_value_print (const GValue *value,
}
}
-static gboolean
-transparent_color_value_parse (GtkCssParser *parser,
- GFile *base,
- GValue *value)
-{
- if (_gtk_css_parser_try (parser, "transparent", TRUE))
- {
- GdkRGBA transparent = { 0, 0, 0, 0 };
-
- g_value_set_boxed (value, &transparent);
-
- return TRUE;
- }
-
- return rgba_value_parse (parser, base, value);
-}
-
/*** API ***/
static void
@@ -2121,7 +2104,7 @@ gtk_style_property_init_properties (void)
GDK_TYPE_RGBA, 0),
0,
NULL,
- transparent_color_value_parse,
+ NULL,
NULL,
&value);
g_value_unset (&value);
@@ -2331,7 +2314,7 @@ gtk_style_property_init_properties (void)
GDK_TYPE_RGBA, 0),
0,
NULL,
- transparent_color_value_parse,
+ NULL,
NULL,
&value);
_gtk_style_property_register (g_param_spec_boxed ("border-right-color",
@@ -2340,7 +2323,7 @@ gtk_style_property_init_properties (void)
GDK_TYPE_RGBA, 0),
0,
NULL,
- transparent_color_value_parse,
+ NULL,
NULL,
&value);
_gtk_style_property_register (g_param_spec_boxed ("border-bottom-color",
@@ -2349,7 +2332,7 @@ gtk_style_property_init_properties (void)
GDK_TYPE_RGBA, 0),
0,
NULL,
- transparent_color_value_parse,
+ NULL,
NULL,
&value);
_gtk_style_property_register (g_param_spec_boxed ("border-left-color",
@@ -2358,7 +2341,7 @@ gtk_style_property_init_properties (void)
GDK_TYPE_RGBA, 0),
0,
NULL,
- transparent_color_value_parse,
+ NULL,
NULL,
&value);
g_value_unset (&value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]