mirror of
https://gitlab.gnome.org/julianschacher/top-bar-organizer.git
synced 2025-10-27 07:09:07 +00:00
fix: set selected visibility option to settings value on options open
This commit is contained in:
parent
bcb61b51ac
commit
a477d3b95a
@ -30,6 +30,17 @@ export default class PrefsBoxOrderItemOptionsDialog extends Adw.Dialog {
|
||||
this.item = item;
|
||||
// Load the settings.
|
||||
this.#settings = ExtensionPreferences.lookupByURL(import.meta.url)!.getSettings();
|
||||
|
||||
// Set the selected visibility row choice to the settings value.
|
||||
const itemsToHide = new Set(this.#settings.get_strv("hide"));
|
||||
const itemsToShow = new Set(this.#settings.get_strv("show"));
|
||||
if (itemsToHide.has(this.item)) {
|
||||
this._visibility_row.set_selected(1);
|
||||
} else if (itemsToShow.has(this.item)) {
|
||||
this._visibility_row.set_selected(2);
|
||||
} else {
|
||||
this._visibility_row.set_selected(0);
|
||||
}
|
||||
}
|
||||
|
||||
onVisibilityRowSelectionChanged(): void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user