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



commit 9adbc3027d2da9e63162169e7881b2b8705e0c86
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]