diff --git a/caffeine@patapon.info/preferences/displayPage.js b/caffeine@patapon.info/preferences/displayPage.js index 81abc4dc..23f727bb 100644 --- a/caffeine@patapon.info/preferences/displayPage.js +++ b/caffeine@patapon.info/preferences/displayPage.js @@ -55,6 +55,13 @@ class CaffeineDisplayPage extends Adw.PreferencesPage { selected: this._settings.get_enum(this._settingsKey.SHOW_INDICATOR) }); + // Show quick settings toggle + let showToggleRow = new Adw.SwitchRow({ + title: _('Show quick settings toggle'), + subtitle: _('Enable or disable the toggle in the quick settings menu'), + active: this._settings.get_boolean(this._settingsKey.SHOW_TOGGLE) + }); + // Show timer let showTimerRow = new Adw.SwitchRow({ title: _('Show timer in top panel'), @@ -86,6 +93,7 @@ class CaffeineDisplayPage extends Adw.PreferencesPage { // Add elements displayGroup.add(showStatusIndicatorRow); + displayGroup.add(showToggleRow); displayGroup.add(showTimerRow); displayGroup.add(notificationRow); displayGroup.add(this.posIndicatorOffsetRow); @@ -102,6 +110,9 @@ class CaffeineDisplayPage extends Adw.PreferencesPage { } this._settings.set_enum(this._settingsKey.SHOW_INDICATOR, widget.selected); }); + showToggleRow.connect('notify::active', (widget) => { + this._settings.set_boolean(this._settingsKey.SHOW_TOGGLE, widget.get_active()); + }); showTimerRow.connect('notify::active', (widget) => { this._settings.set_boolean(this._settingsKey.SHOW_TIMER, widget.get_active()); }); diff --git a/caffeine@patapon.info/prefs.js b/caffeine@patapon.info/prefs.js index 4a1df849..66749c93 100644 --- a/caffeine@patapon.info/prefs.js +++ b/caffeine@patapon.info/prefs.js @@ -35,6 +35,7 @@ const SettingsKey = { SHOW_INDICATOR: 'show-indicator', SHOW_NOTIFICATIONS: 'show-notifications', SHOW_TIMER: 'show-timer', + SHOW_TOGGLE: 'show-toggle', DURATION_TIMER_INDEX: 'duration-timer', DURATION_TIMER_LIST: 'duration-timer-list', USE_CUSTOM_DURATION: 'use-custom-duration',