GtkCssProvider: Allow to enable debug at runtime
Add a private function that lets us decide at runtime whether to keep css section information around - this will be useful in the GtkInspector.
This commit is contained in:
parent
b25b33f79f
commit
2952739593
@ -1244,13 +1244,22 @@ gtk_css_provider_parsing_error (GtkCssProvider *provider,
|
||||
}
|
||||
}
|
||||
|
||||
/* This is exported privately for use in GtkInspector.
|
||||
* It is the callers responsibility to reparse the current theme.
|
||||
*/
|
||||
void
|
||||
gtk_css_provider_set_keep_css_sections (void)
|
||||
{
|
||||
gtk_keep_css_sections = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_provider_class_init (GtkCssProviderClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
if (g_getenv ("GTK_CSS_DEBUG"))
|
||||
gtk_keep_css_sections = TRUE;
|
||||
gtk_css_provider_set_keep_css_sections ();
|
||||
|
||||
/**
|
||||
* GtkCssProvider::parsing-error:
|
||||
|
@ -28,6 +28,8 @@ void _gtk_css_provider_load_named (GtkCssProvider *provider,
|
||||
const gchar *name,
|
||||
const gchar *variant);
|
||||
|
||||
void gtk_css_provider_set_keep_css_sections (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_PROVIDER_PRIVATE_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user