[gtk+/gtk-style-context: 423/490] GtkCssProvider: Use default value when handling "none".



commit 3f1fe20be302c2325e62c5b60f7df11e5d2506a3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Nov 21 19:36:59 2010 +0100

    GtkCssProvider: Use default value when handling "none".
    
    This way the default value has a way to override other values in previous
    GtkStyleProviders when merged.

 gtk/gtkcssprovider.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index f400b07..4e260b5 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2964,8 +2964,11 @@ parse_rule (GtkCssProvider *css_provider,
 
           if (strcmp (value_str, "none") == 0)
             {
-              /* Remove/unset the current value */
-              g_hash_table_remove (priv->cur_properties, prop);
+              /* Insert the default value, so it has an opportunity
+               * to override other style providers when merged
+               */
+              g_param_value_set_default (pspec, val);
+              g_hash_table_insert (priv->cur_properties, prop, val);
             }
           else if (pspec->value_type == G_TYPE_STRING)
             {



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