diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-01-15 00:58:56 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-01-15 14:03:51 -0500 |
commit | 04fa4b15fe2be049d112586f18d513ea125949d8 (patch) | |
tree | 289750a186169f498e411c5d6ecefb8b011e6a74 | |
parent | a8e9cc27d97d6499fc04541eb9c66e89d79fa377 (diff) | |
download | gtk+-04fa4b15fe2be049d112586f18d513ea125949d8.tar.gz |
css: Mark the default style in debug dumps
This helps identifying unexpected situations,
since the default style should never be seen
in the wild.
-rw-r--r-- | gtk/gtkcssstyle.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c index d6ff5cbb84..effc2fb4d3 100644 --- a/gtk/gtkcssstyle.c +++ b/gtk/gtkcssstyle.c @@ -126,11 +126,17 @@ gtk_css_style_print (GtkCssStyle *style, gboolean skip_initial) { guint i; + GtkCssStyle *default_style; gboolean retval = FALSE; g_return_val_if_fail (GTK_IS_CSS_STYLE (style), FALSE); g_return_val_if_fail (string != NULL, FALSE); + default_style = gtk_css_static_style_get_default (); + + if (style == default_style) + g_string_append_printf (string, "%*sDEFAULT STYLE\n", indent, ""); + for (i = 0; i < _gtk_css_style_property_get_n_properties (); i++) { GtkCssSection *section; @@ -143,7 +149,6 @@ gtk_css_style_print (GtkCssStyle *style, if (skip_initial) { GtkCssValue *initial = _gtk_css_style_property_get_initial_value (prop); - GtkCssStyle *default_style = gtk_css_static_style_get_default (); GtkCssValue *computed = _gtk_css_value_compute (initial, i, GTK_STYLE_PROVIDER (gtk_settings_get_default ()), default_style, |