Skip to content

Commit

Permalink
Reimplement settings disabling for libadwaita
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthayhurst committed Aug 18, 2023
1 parent a1d85e6 commit 136a378
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions extension/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class PrefsPage extends Adw.PreferencesPage {

this._extensionSettings = settings;
this._settingGroups = {};
this._settingRows = {};

//Setup settings
this._createGroups(groupsInfo);
Expand Down Expand Up @@ -60,27 +61,27 @@ class PrefsPage extends Adw.PreferencesPage {
Gio.SettingsBindFlags.DEFAULT
);

//Add the row to the group
//Add the row to the group, and save for later
this._settingGroups[settingInfo[0]].add(settingRow);
this._settingRows[settingInfo[1]] = settingRow;
});
}

_updateEnabledSettings() {
return; //TODO
/*
- If quick settings are enabled, disable 'move-icon-setting'
- If quick settings grouping is disabled, disable 'use-quick-subtitle'
- If quick settings are enabled, disable 'move-icon-setting' option
- If quick settings grouping is disabled, disable 'use-quick-subtitle' option
*/
/*
let moveIconRow = this._builder.get_object('move-icon-setting');
let groupQuickSettingsRow = this._builder.get_object('group-quick-settings-setting');
let quickSubtitleSettingsRow = this._builder.get_object('use-quick-subtitle-setting');

if (this._settings.get_boolean('use-quick-settings')) {
let moveIconRow = this._settingRows['move-icon-right'];
let groupQuickSettingsRow = this._settingRows['group-quick-settings'];
let quickSubtitleSettingsRow = this._settingRows['use-quick-subtitle'];

if (this._extensionSettings.get_boolean('use-quick-settings')) {
moveIconRow.set_sensitive(false);
groupQuickSettingsRow.set_sensitive(true);

if (!this._settings.get_boolean('group-quick-settings')) {
if (!this._extensionSettings.get_boolean('group-quick-settings')) {
quickSubtitleSettingsRow.set_sensitive(false);
} else {
quickSubtitleSettingsRow.set_sensitive(true);
Expand All @@ -89,7 +90,7 @@ class PrefsPage extends Adw.PreferencesPage {
moveIconRow.set_sensitive(true);
groupQuickSettingsRow.set_sensitive(false);
quickSubtitleSettingsRow.set_sensitive(false);
}*/
}
}
});

Expand Down

0 comments on commit 136a378

Please sign in to comment.