[gtk+] Use CSS syntax for drop highlighting



commit 158dbbc88f2c2735c417d27bbc96dbecd7a67656
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Dec 24 18:04:15 2015 -0500

    Use CSS syntax for drop highlighting
    
    I hadn't noticed the :drop() pseudo state in the CSS4 Selectors
    spec when I added this a while ago. This commit renames
    GTK_STATE_FLAG_DND to GTK_STATE_FLAG_DROP_ACTIVE and adds
    :drop(active) as equivalent to the :dnd pseudo state.

 gtk/gtkcssselector.c |    4 +++-
 gtk/gtkdnd.c         |    4 ++--
 gtk/gtkenums.h       |    4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index 0db8c36..e41dc0f 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -1192,7 +1192,9 @@ parse_selector_pseudo_class (GtkCssParser   *parser,
     { "link",         GTK_STATE_FLAG_LINK, },
     { "visited",      GTK_STATE_FLAG_VISITED, },
     { "checked",      GTK_STATE_FLAG_CHECKED, },
-    { "dnd"    ,      GTK_STATE_FLAG_DND, }
+    { "dnd",          GTK_STATE_FLAG_DROP_ACTIVE, },
+    { "drop(active)", GTK_STATE_FLAG_DROP_ACTIVE, }
+
   };
   guint i;
 
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 25ed298..95cafaa 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -980,7 +980,7 @@ gtk_drag_highlight (GtkWidget  *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_DND, FALSE);
+  gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE, FALSE);
 }
 
 /**
@@ -995,7 +995,7 @@ gtk_drag_unhighlight (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DND);
+  gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE);
 }
 
 static void
diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h
index 3d99fd9..18e2895 100644
--- a/gtk/gtkenums.h
+++ b/gtk/gtkenums.h
@@ -857,7 +857,7 @@ typedef enum
  * @GTK_STATE_FLAG_LINK: Widget is a link. Since 3.12
  * @GTK_STATE_FLAG_VISITED: The location the widget points to has already been visited. Since 3.12
  * @GTK_STATE_FLAG_CHECKED: Widget is checked. Since 3.14
- * @GTK_STATE_FLAG_DND: Widget is highlighted as a drop target for DND. Since 3.20
+ * @GTK_STATE_FLAG_DROP_ACTIVE: Widget is highlighted as a drop target for DND. Since 3.20
  *
  * Describes a widget state. Widget states are used to match the widget
  * against CSS pseudo-classes. Note that GTK extends the regular CSS
@@ -878,7 +878,7 @@ typedef enum
   GTK_STATE_FLAG_LINK         = 1 << 9,
   GTK_STATE_FLAG_VISITED      = 1 << 10,
   GTK_STATE_FLAG_CHECKED      = 1 << 11,
-  GTK_STATE_FLAG_DND          = 1 << 12
+  GTK_STATE_FLAG_DROP_ACTIVE  = 1 << 12
 } GtkStateFlags;
 
 /**


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