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.
This commit is contained in:
Matthias Clasen 2015-12-24 18:04:15 -05:00
parent b3c1454dcc
commit 158dbbc88f
3 changed files with 7 additions and 5 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;
/**