Skip to content

Commit

Permalink
Switch to strings for menu type, rather than a boolean
Browse files Browse the repository at this point in the history
This is in preparation for a third type of menu
  • Loading branch information
stuarthayhurst committed Jun 9, 2023
1 parent 126918e commit b953ba5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions extension/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,15 @@ class Extension {
this._extensionSettings.disconnect(this._settingsChangedSignal);
}

_useQuickSettings() {
//Return true if running GNOME 43+ and quick settings are enabled
return this._extensionSettings.get_boolean('use-quick-settings') && ShellVersion >= 43;
_decideMenuType() {
//Return 'quick-toggles' if running GNOME 43+ and quick settings are enabled
if (this._extensionSettings.get_boolean('use-quick-settings')) {
if (ShellVersion >= 43) {
return 'quick-toggles';
}
}

return 'indicator';
}

initMenu() {
Expand All @@ -246,9 +252,10 @@ class Extension {

_createMenu() {
//Create the correct type of menu, from preference and capabilities
if (this._useQuickSettings()) {
let menuType = this._decideMenuType();
if (menuType == 'quick-toggles') {
this._privacyManager = new QuickSettingsManager();
} else {
} else if (menuType == 'indicator') {
this._privacyManager = new IndicatorSettingsManager();
}
}
Expand Down

0 comments on commit b953ba5

Please sign in to comment.