[gtk+] Support the new state in CSS selectors



commit 4209c1762d645fe4000db736d47a7d034cc268d1
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 28 22:26:30 2017 -0400

    Support the new state in CSS selectors
    
    Make :focus(visible) match the new state.

 gtk/gtkcssselector.c |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index 961e78e..e80b442 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -683,7 +683,8 @@ gtk_css_pseudoclass_name (GtkStateFlags state)
     "link",
     "visited",
     "checked",
-    "drop(active)"
+    "drop(active)",
+    "focus(visible)"
   };
   guint i;
 
@@ -1108,22 +1109,23 @@ parse_selector_pseudo_class (GtkCssParser   *parser,
     int            position_a;
     int            position_b;
   } pseudo_classes[] = {
-    { "first-child",   0,                           POSITION_FORWARD,  0, 1 },
-    { "last-child",    0,                           POSITION_BACKWARD, 0, 1 },
-    { "only-child",    0,                           POSITION_ONLY,     0, 0 },
-    { "active",        GTK_STATE_FLAG_ACTIVE, },
-    { "hover",         GTK_STATE_FLAG_PRELIGHT, },
-    { "selected",      GTK_STATE_FLAG_SELECTED, },
-    { "disabled",      GTK_STATE_FLAG_INSENSITIVE, },
-    { "indeterminate", GTK_STATE_FLAG_INCONSISTENT, },
-    { "focus",         GTK_STATE_FLAG_FOCUSED, },
-    { "backdrop",      GTK_STATE_FLAG_BACKDROP, },
-    { "dir(ltr)",      GTK_STATE_FLAG_DIR_LTR, },
-    { "dir(rtl)",      GTK_STATE_FLAG_DIR_RTL, },
-    { "link",          GTK_STATE_FLAG_LINK, },
-    { "visited",       GTK_STATE_FLAG_VISITED, },
-    { "checked",       GTK_STATE_FLAG_CHECKED, },
-    { "drop(active)",  GTK_STATE_FLAG_DROP_ACTIVE, }
+    { "first-child",    0,                           POSITION_FORWARD,  0, 1 },
+    { "last-child",     0,                           POSITION_BACKWARD, 0, 1 },
+    { "only-child",     0,                           POSITION_ONLY,     0, 0 },
+    { "active",         GTK_STATE_FLAG_ACTIVE, },
+    { "hover",          GTK_STATE_FLAG_PRELIGHT, },
+    { "selected",       GTK_STATE_FLAG_SELECTED, },
+    { "disabled",       GTK_STATE_FLAG_INSENSITIVE, },
+    { "indeterminate",  GTK_STATE_FLAG_INCONSISTENT, },
+    { "focus(visible)", GTK_STATE_FLAG_FOCUS_VISIBLE, },
+    { "focus",          GTK_STATE_FLAG_FOCUSED, },
+    { "backdrop",       GTK_STATE_FLAG_BACKDROP, },
+    { "dir(ltr)",       GTK_STATE_FLAG_DIR_LTR, },
+    { "dir(rtl)",       GTK_STATE_FLAG_DIR_RTL, },
+    { "link",           GTK_STATE_FLAG_LINK, },
+    { "visited",        GTK_STATE_FLAG_VISITED, },
+    { "checked",        GTK_STATE_FLAG_CHECKED, },
+    { "drop(active)",   GTK_STATE_FLAG_DROP_ACTIVE, }
   };
 
   guint i;


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