@@ -8,15 +8,19 @@ ColumnLayout {
88 id: root
99 property var pluginApi: null
1010
11- // 1. Local state ('edit' convention and official fallbacks)
12- property string editOverlayPath: pluginApi? .pluginSettings ? .overlayPath || pluginApi? .manifest ? .metadata ? .defaultSettings ? .overlayPath || " ~/.cache/noctalia/HVE/overlay.conf"
13- property bool editAutoApply: pluginApi? .pluginSettings ? .autoApply ?? pluginApi? .manifest ? .metadata ? .defaultSettings ? .autoApply ?? true
14- property string editIcon: pluginApi? .pluginSettings ? .icon || pluginApi? .manifest ? .metadata ? .defaultSettings ? .icon || " adjustments-horizontal"
15- property string editIconColor: pluginApi? .pluginSettings ? .iconColor || pluginApi? .manifest ? .metadata ? .defaultSettings ? .iconColor || " primary"
11+ // Settings and default values (Official Noctalia pattern)
12+ readonly property var cfg: pluginApi? .pluginSettings || ({})
13+ readonly property var defaults: pluginApi? .manifest ? .metadata ? .defaultSettings || ({})
14+
15+ // 1. Local state ('edit' convention to avoid unnecessary disk writes)
16+ property string editOverlayPath: cfg .overlayPath ?? defaults .overlayPath ?? " ~/.cache/noctalia/HVE/overlay.conf"
17+ property bool editAutoApply: cfg .autoApply ?? defaults .autoApply ?? true
18+ property string editIcon: cfg .icon ?? defaults .icon ?? " adjustments-horizontal"
19+ property string editIconColor: cfg .iconColor ?? defaults .iconColor ?? " primary"
1620
1721 spacing: Style .marginM
1822
19- // ── Preview ────────────────────────────────────────────────────────────────
23+ // ── Preview ──────────────────────────────────────────────────────────
2024 RowLayout {
2125 spacing: Style .marginM
2226 Layout .alignment : Qt .AlignHCenter
@@ -38,7 +42,7 @@ ColumnLayout {
3842 }
3943 }
4044
41- // ── Icon Configuration ───────────────────────────────────────────────────
45+ // ── Icon Configuration ────────────────────────────────────────────────
4246 NButton {
4347 Layout .fillWidth : true
4448 text: pluginApi? .tr (" settings.change_icon_button" )
@@ -58,12 +62,12 @@ ColumnLayout {
5862 label: pluginApi? .tr (" settings.icon_color_label" )
5963 currentKey: root .editIconColor
6064 onSelected : key => { root .editIconColor = key }
61- defaultValue: pluginApi ? . manifest ? . metadata ? . defaultSettings ? .iconColor || " primary"
65+ defaultValue: defaults .iconColor || " primary"
6266 }
6367
6468 NDivider { Layout .fillWidth : true }
6569
66- // ── Files and Application Configuration (Recovered Section) ────────────────
70+ // ── Files and Application Configuration ──────────────── ────────────────
6771 NTextInput {
6872 Layout .fillWidth : true
6973 label: pluginApi? .tr (" settings.path_label" )
@@ -81,7 +85,7 @@ ColumnLayout {
8185 onToggled : checked => { root .editAutoApply = checked }
8286 }
8387
84- // ── Save Function ────────────────────────────── ──────────────────────────
88+ // ── Save Function (Required by the Shell) ──────────────────────────
8589 function saveSettings () {
8690 if (! pluginApi) return
8791
0 commit comments