mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
Refine the selector tree printing
Also show which tree nodes have exact matches.
This commit is contained in:
parent
eff129323f
commit
a463dccd81
@ -1970,6 +1970,7 @@ _gtk_css_selector_tree_print (const GtkCssSelectorTree *tree, GString *str, char
|
||||
{
|
||||
gboolean first = TRUE;
|
||||
int len, i;
|
||||
gpointer *matches;
|
||||
|
||||
for (; tree != NULL; tree = gtk_css_selector_tree_get_sibling (tree), first = FALSE)
|
||||
{
|
||||
@ -1993,6 +1994,16 @@ _gtk_css_selector_tree_print (const GtkCssSelectorTree *tree, GString *str, char
|
||||
|
||||
len = str->len;
|
||||
tree->selector.class->print (&tree->selector, str);
|
||||
matches = gtk_css_selector_tree_get_matches (tree);
|
||||
if (matches)
|
||||
{
|
||||
int n;
|
||||
for (n = 0; matches[n] != NULL; n++) ;
|
||||
if (n == 1)
|
||||
g_string_append (str, " (1 match)");
|
||||
else
|
||||
g_string_append_printf (str, " (%d matches)", n);
|
||||
}
|
||||
len = str->len - len;
|
||||
|
||||
if (gtk_css_selector_tree_get_previous (tree))
|
||||
|
Loading…
Reference in New Issue
Block a user