[gtk/matthiasc/css-change-tracking-3: 1/5] css: Fix the ANY atcher state list



commit 79daed58253873ec0e7f5fae1cb90c0c4f345751
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 15 17:34:03 2020 -0500

    css: Fix the ANY atcher state list
    
    The ANY and matcher was not, in fact, matching any state,
    since the list of states was not up-to-date.
    
    The same fix applies to the superset matcher as well.

 gtk/gtkcssmatcher.c | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c
index fb80c3ef80..0b2c5442df 100644
--- a/gtk/gtkcssmatcher.c
+++ b/gtk/gtkcssmatcher.c
@@ -383,10 +383,20 @@ gtk_css_matcher_any_get_state (const GtkCssMatcher *matcher)
 {
   /* XXX: This gets tricky when we implement :not() */
 
-  return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED
-    | GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_INCONSISTENT
-    | GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_LINK
-    | GTK_STATE_FLAG_VISITED;
+  return GTK_STATE_FLAG_ACTIVE |
+         GTK_STATE_FLAG_PRELIGHT |
+         GTK_STATE_FLAG_SELECTED |
+         GTK_STATE_FLAG_INSENSITIVE |
+         GTK_STATE_FLAG_INCONSISTENT |
+         GTK_STATE_FLAG_FOCUSED |
+         GTK_STATE_FLAG_BACKDROP |
+         GTK_STATE_FLAG_DIR_LTR |
+         GTK_STATE_FLAG_DIR_RTL |
+         GTK_STATE_FLAG_LINK |
+         GTK_STATE_FLAG_VISITED |
+         GTK_STATE_FLAG_CHECKED |
+         GTK_STATE_FLAG_DROP_ACTIVE |
+         GTK_STATE_FLAG_FOCUS_VISIBLE;
 }
 
 static gboolean
@@ -464,10 +474,20 @@ gtk_css_matcher_superset_get_state (const GtkCssMatcher *matcher)
   if (matcher->superset.relevant & GTK_CSS_CHANGE_STATE)
     return _gtk_css_matcher_get_state (matcher->superset.subset);
   else
-    return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED
-      | GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_INCONSISTENT
-      | GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_LINK
-      | GTK_STATE_FLAG_VISITED;
+    return GTK_STATE_FLAG_ACTIVE |
+           GTK_STATE_FLAG_PRELIGHT |
+           GTK_STATE_FLAG_SELECTED |
+           GTK_STATE_FLAG_INSENSITIVE |
+           GTK_STATE_FLAG_INCONSISTENT |
+           GTK_STATE_FLAG_FOCUSED |
+           GTK_STATE_FLAG_BACKDROP |
+           GTK_STATE_FLAG_DIR_LTR |
+           GTK_STATE_FLAG_DIR_RTL |
+           GTK_STATE_FLAG_LINK |
+           GTK_STATE_FLAG_VISITED |
+           GTK_STATE_FLAG_CHECKED |
+           GTK_STATE_FLAG_DROP_ACTIVE |
+           GTK_STATE_FLAG_FOCUS_VISIBLE;
 }
 
 static gboolean


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