"nth-child(odd)",
"first-child",
"last-child",
+ "only-child",
"sorted"
};
guint i;
"selected",
"insensitive",
"inconsistent",
- "focus"
+ "focus",
+ "backdrop"
};
guint i;
flags |= GTK_REGION_FIRST;
if (sibling_id + 1 == n_siblings)
flags |= GTK_REGION_LAST;
+ if (n_siblings == 1)
+ flags |= GTK_REGION_ONLY;
return flags;
}
* _gtk_css_selector_matches:
* @selector: the selector
* @path: the path to check
- * @length: How many elements of the path are to be used
+ * @state: The state to match
*
* Checks if the @selector matches the given @path. If @length is
* smaller than the number of elements in @path, it is assumed that
gboolean
_gtk_css_selector_matches (const GtkCssSelector *selector,
const GtkWidgetPath *path,
- guint length)
+ GtkStateFlags state)
{
GSList *list;
gboolean match;
+ guint length;
g_return_val_if_fail (selector != NULL, FALSE);
g_return_val_if_fail (path != NULL, FALSE);
- g_return_val_if_fail (length <= gtk_widget_path_length (path), FALSE);
+ if ((selector->state & state) != selector->state)
+ return FALSE;
+
+ length = gtk_widget_path_length (path);
if (length == 0)
return FALSE;