[gtk+/gtk-style-context: 85/191] GtkCssProvider: Set default value if no state pseudo-class is specified.



commit 0da10a9a505c9040a21b88c9baf778e4b72eff5e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 4 19:58:07 2010 +0200

    GtkCssProvider: Set default value if no state pseudo-class is specified.

 gtk/gtkcssprovider.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 9360488..fbebb47 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -444,6 +444,7 @@ compare_selector (GtkWidgetPath *path,
 
       if (match)
         {
+          /* Only 4 bits are actually used */
           score <<= 4;
           score |= elem_score;
         }
@@ -529,7 +530,12 @@ gtk_style_get_style (GtkStyleProvider *provider,
       g_hash_table_iter_init (&iter, info->style);
 
       while (g_hash_table_iter_next (&iter, &key, &value))
-        gtk_style_set_set_property (set, key, info->state, value);
+        {
+          if (info->state == GTK_STATE_NORMAL)
+            gtk_style_set_set_default (set, key, value);
+          else
+            gtk_style_set_set_property (set, key, info->state, value);
+        }
     }
 
   g_array_free (priority_info, TRUE);



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