css: Add a :dnd pseudoclass

This will be used for drag highlighting.
This commit is contained in:
Matthias Clasen
2015-12-02 23:23:36 -05:00
parent 574246a3d8
commit cbde3ee01f
5 changed files with 16 additions and 4 deletions

View File

@ -744,7 +744,8 @@ print_pseudoclass_state (const GtkCssSelector *selector,
"dir(rtl)",
"link",
"visited",
"checked"
"checked",
"dnd"
};
guint i;
@ -1188,7 +1189,8 @@ parse_selector_pseudo_class (GtkCssParser *parser,
{ "dir(rtl)", GTK_STATE_FLAG_DIR_RTL, },
{ "link", GTK_STATE_FLAG_LINK, },
{ "visited", GTK_STATE_FLAG_VISITED, },
{ "checked", GTK_STATE_FLAG_CHECKED, }
{ "checked", GTK_STATE_FLAG_CHECKED, },
{ "dnd" , GTK_STATE_FLAG_DND, }
};
guint i;

View File

@ -857,6 +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
*
* Describes a widget state. Widget states are used to match the widget
* against CSS pseudo-classes. Note that GTK extends the regular CSS
@ -876,7 +877,8 @@ typedef enum
GTK_STATE_FLAG_DIR_RTL = 1 << 8,
GTK_STATE_FLAG_LINK = 1 << 9,
GTK_STATE_FLAG_VISITED = 1 << 10,
GTK_STATE_FLAG_CHECKED = 1 << 11
GTK_STATE_FLAG_CHECKED = 1 << 11,
GTK_STATE_FLAG_DND = 1 << 12
} GtkStateFlags;
/**

View File

@ -34,7 +34,7 @@
G_BEGIN_DECLS
#define GTK_STATE_FLAGS_BITS 12
#define GTK_STATE_FLAGS_BITS 13
struct _GtkWidgetPrivate
{