From ff05cc48499a6f3f446ea839987f73384e781d52 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 18 Jun 2010 16:46:31 +0200 Subject: [PATCH] GtkCssProvider: Parse boolean values. --- gtk/gtkcssprovider.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index acc73c0f75..fef896c3e1 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -596,7 +596,7 @@ css_provider_apply_scope (GtkCssProvider *css_provider, { priv->scanner->config->cset_identifier_first = G_CSET_a_2_z "#-_0123456789" G_CSET_A_2_Z; priv->scanner->config->cset_identifier_nth = G_CSET_a_2_z "#-_ 0123456789" G_CSET_A_2_Z; - priv->scanner->config->scan_identifier_1char = FALSE; + priv->scanner->config->scan_identifier_1char = TRUE; } else if (scope == SCOPE_SELECTOR) { @@ -894,6 +894,14 @@ parse_value (GType type, font_desc = pango_font_description_from_string (value_str); g_value_take_boxed (value, font_desc); } + else if (type == G_TYPE_BOOLEAN) + { + if (value_str[0] == '1' || + g_ascii_strcasecmp (value_str, "true") == 0) + g_value_set_boolean (value, TRUE); + else + g_value_set_boolean (value, FALSE); + } else if (type == G_TYPE_INT) g_value_set_int (value, atoi (value_str)); else if (type == G_TYPE_DOUBLE)