Commit 9b1c9431 authored by Timm Bäder's avatar Timm Bäder 👎 Committed by Benjamin Otte

css parser: Add :link and :visited

... which are both to be used for links instead of the current
-GtkWidget-link-color and -GtkWidget-visited-link-color

https://bugzilla.gnome.org/show_bug.cgi?id=709629
parent 74dc941c
......@@ -230,7 +230,8 @@ gtk_css_matcher_any_get_state (const GtkCssMatcher *matcher)
return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED
| GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_INCONSISTENT
| GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_BACKDROP;
| GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_LINK
| GTK_STATE_FLAG_VISITED;
}
static gboolean
......@@ -326,7 +327,8 @@ gtk_css_matcher_superset_get_state (const GtkCssMatcher *matcher)
else
return GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED
| GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_INCONSISTENT
| GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_BACKDROP;
| GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_LINK
| GTK_STATE_FLAG_VISITED;
}
static gboolean
......
......@@ -1827,7 +1827,9 @@ parse_selector_pseudo_class (GtkCssParser *parser,
{ "focus", GTK_STATE_FLAG_FOCUSED, },
{ "backdrop", GTK_STATE_FLAG_BACKDROP, },
{ "dir(ltr)", GTK_STATE_FLAG_DIR_LTR, },
{ "dir(rtl)", GTK_STATE_FLAG_DIR_RTL, }
{ "dir(rtl)", GTK_STATE_FLAG_DIR_RTL, },
{ "link", GTK_STATE_FLAG_LINK, },
{ "visited", GTK_STATE_FLAG_VISITED, }
};
guint i;
......
......@@ -889,6 +889,8 @@ typedef enum
* @GTK_STATE_FLAG_BACKDROP: Widget is in a background toplevel window.
* @GTK_STATE_FLAG_DIR_LTR: Widget is in left-to-right text direction. Since 3.8
* @GTK_STATE_FLAG_DIR_RTL: Widget is in right-to-left text direction. Since 3.8
* @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
*
* Describes a widget state. Widget states are used to match the widget
* against CSS pseudo-classes. Note that GTK extends the regular CSS
......@@ -905,7 +907,9 @@ typedef enum
GTK_STATE_FLAG_FOCUSED = 1 << 5,
GTK_STATE_FLAG_BACKDROP = 1 << 6,
GTK_STATE_FLAG_DIR_LTR = 1 << 7,
GTK_STATE_FLAG_DIR_RTL = 1 << 8
GTK_STATE_FLAG_DIR_RTL = 1 << 8,
GTK_STATE_FLAG_LINK = 1 << 9,
GTK_STATE_FLAG_VISITED = 1 << 10
} GtkStateFlags;
/**
......
......@@ -389,7 +389,7 @@
#define WIDGET_CLASS(w) GTK_WIDGET_GET_CLASS (w)
#define GTK_STATE_FLAGS_BITS 9
#define GTK_STATE_FLAGS_BITS 11
typedef struct {
gchar *name; /* Name of the template automatic child */
......
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