summaryrefslogtreecommitdiff
path: root/gtk/gtkcssmatcher.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-07-19 23:26:12 +0200
committerBenjamin Otte <otte@redhat.com>2014-07-19 23:42:39 +0200
commit19eb1614de30042ae39ca95c854803e03f3a6bae (patch)
treef8ede6598c4997902c4e28d04d1ac7cc2601f548 /gtk/gtkcssmatcher.c
parentbe09e0ed4ac3c98d2973f98e10d96f86832fb49f (diff)
downloadgtk+-19eb1614de30042ae39ca95c854803e03f3a6bae.tar.gz
cssmatcher: Use widget path's state
Don't take a state when constructing the CSS matcher. Instead, rely on the newly introduced state in the widget path. This way, the state can be queried not only on the first element, but on all elements of the widget path.
Diffstat (limited to 'gtk/gtkcssmatcher.c')
-rw-r--r--gtk/gtkcssmatcher.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c
index 04d4571ce1..d169c274cf 100644
--- a/gtk/gtkcssmatcher.c
+++ b/gtk/gtkcssmatcher.c
@@ -32,7 +32,6 @@ gtk_css_matcher_widget_path_get_parent (GtkCssMatcher *matcher,
matcher->path.klass = child->path.klass;
matcher->path.path = child->path.path;
- matcher->path.state_flags = 0;
matcher->path.index = child->path.index - 1;
matcher->path.sibling_index = gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index);
@@ -48,7 +47,6 @@ gtk_css_matcher_widget_path_get_previous (GtkCssMatcher *matcher,
matcher->path.klass = next->path.klass;
matcher->path.path = next->path.path;
- matcher->path.state_flags = 0;
matcher->path.index = next->path.index;
matcher->path.sibling_index = next->path.sibling_index - 1;
@@ -58,7 +56,7 @@ gtk_css_matcher_widget_path_get_previous (GtkCssMatcher *matcher,
static GtkStateFlags
gtk_css_matcher_widget_path_get_state (const GtkCssMatcher *matcher)
{
- return matcher->path.state_flags;
+ return gtk_widget_path_iter_get_state (matcher->path.path, matcher->path.index);
}
static gboolean
@@ -192,15 +190,13 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = {
gboolean
_gtk_css_matcher_init (GtkCssMatcher *matcher,
- const GtkWidgetPath *path,
- GtkStateFlags state)
+ const GtkWidgetPath *path)
{
if (gtk_widget_path_length (path) == 0)
return FALSE;
matcher->path.klass = &GTK_CSS_MATCHER_WIDGET_PATH;
matcher->path.path = path;
- matcher->path.state_flags = state;
matcher->path.index = gtk_widget_path_length (path) - 1;
matcher->path.sibling_index = gtk_widget_path_iter_get_sibling_index (path, matcher->path.index);