prefs: add hide-top-bar switch

closes #239
This commit is contained in:
Ole Jørgen Brønner
2020-02-08 16:04:44 +01:00
parent 8a9d0c8bec
commit 0501e57745
+6
View File
@@ -295,6 +295,7 @@ class SettingsWidget {
let backgroundBox = new Gtk.Box({spacing: 32}); // same spacing as used in glade for default background
let background = new Gtk.FileChooserButton();
let clearBackground = new Gtk.Button({label: 'Clear', sensitive: settings.get_string('background') != ''});
let hideTopBarSwitch = new Gtk.Switch({active: !settings.get_boolean('show-top-bar')});
backgroundBox.add(background)
backgroundBox.add(clearBackground)
@@ -306,6 +307,7 @@ class SettingsWidget {
list.add(createRow('Name', nameEntry));
list.add(createRow('Color', colorButton));
list.add(createRow('Background', backgroundBox));
list.add(createRow('Hide top bar', hideTopBarSwitch));
list.add(createRow('Directory', directoryChooser));
let rgba = new Gdk.RGBA();
@@ -360,6 +362,10 @@ class SettingsWidget {
clearBackground.sensitive = settings.get_string('background') != '';
});
hideTopBarSwitch.connect('state-set', (gtkswitch_, state) => {
settings.set_boolean('show-top-bar', !state);
});
let dir = settings.get_string('directory')
if (dir === '')
directoryChooser.unselect_all();