Commit 158dbbc8 authored by Matthias Clasen's avatar Matthias Clasen

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.
parent b3c1454d
......@@ -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;
......
......@@ -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
......
......@@ -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;
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment