summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-04-06 23:08:10 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-04-06 23:08:10 +0000
commita0e635366794a3612f29bea0900bb129b537765d (patch)
tree66a46e17394c02dea6c095952c8a6a49dcfdd67f
parentbea7ccb41fdde2dde05b16fcd70f9745dcb36f6a (diff)
downloadgtk+-a0e635366794a3612f29bea0900bb129b537765d.tar.gz
inspector: Disable autoloaded custom css initially
This is a safeguard against possible crashing css being autoloaded.
-rw-r--r--gtk/inspector/css-editor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c
index 630f27f36f..d8d11efa9e 100644
--- a/gtk/inspector/css-editor.c
+++ b/gtk/inspector/css-editor.c
@@ -119,8 +119,9 @@ set_initial_text (GtkInspectorCssEditor *ce)
autosave_file = get_autosave_path ();
- g_file_get_contents (autosave_file, &initial_text, &len, NULL);
- if (!initial_text)
+ if (g_file_get_contents (autosave_file, &initial_text, &len, NULL))
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ce->priv->disable_button), TRUE);
+ else
initial_text = g_strconcat ("/*\n",
_("You can type here any CSS rule recognized by GTK."), "\n",
_("You can temporarily disable this custom CSS by clicking on the “Pause” button above."), "\n\n",