@@ -83,13 +83,6 @@ KCM.SimpleKCM {
83
83
return 0 ;
84
84
}
85
85
86
- function dumpProps (obj ) {
87
- console .error (" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" );
88
- for (var k of Object .keys (obj)) {
89
- print (k + " =" + obj[k]+ " \n " )
90
- }
91
- }
92
-
93
86
Component .onCompleted : {
94
87
runCommand .run (cratePresetsDirCmd)
95
88
runCommand .run (listPresetsCmd)
@@ -105,13 +98,28 @@ KCM.SimpleKCM {
105
98
106
99
ColumnLayout {
107
100
enabled: cfg_isEnabled
101
+ Kirigami .InlineMessage {
102
+ Layout .fillWidth : true
103
+ text: i18n (" Disable preset auto-loading when making changes to presets, unsaved preset settings will be lost when presets change!" )
104
+ visible: true
105
+ type: Kirigami .MessageType .Information
106
+ }
108
107
Label {
109
108
text: i18n (" Switch between different panel presets based on the Panel and window states" )
110
109
Layout .maximumWidth : root .width - (Kirigami .Units .gridUnit * 2 )
111
110
wrapMode: Text .Wrap
112
111
}
113
112
114
113
Kirigami .FormLayout {
114
+ CheckBox {
115
+ id: enabledCheckbox
116
+ Kirigami .FormData .label : i18n (" Enabled:" )
117
+ checked: autoLoadConfig .enabled
118
+ onCheckedChanged: {
119
+ autoLoadConfig .enabled = checked
120
+ updateConfig ()
121
+ }
122
+ }
115
123
Kirigami .ContextualHelpButton {
116
124
toolTipText: i18n (" Priorities go in descending order. E.g. if both <b>Maximized window is shown</b> and <b>Panel touching window</b> have a preset selected, and there is a maximized window on the screen, the <b>Maximized</b> preset will be applied." )
117
125
}
@@ -124,6 +132,7 @@ KCM.SimpleKCM {
124
132
updateConfig ()
125
133
}
126
134
currentIndex: getIndex (model, autoLoadConfig .maximized )
135
+ enabled: enabledCheckbox .checked
127
136
}
128
137
129
138
CheckBox {
@@ -134,7 +143,7 @@ KCM.SimpleKCM {
134
143
autoLoadConfig .maximizedFilterByActive = checked
135
144
updateConfig ()
136
145
}
137
- enabled: autoLoadConfig .maximized ?? " " !== " "
146
+ enabled: ( autoLoadConfig .maximized ?? " " !== " " ) && enabledCheckbox . checked
138
147
}
139
148
140
149
ComboBox {
@@ -146,6 +155,7 @@ KCM.SimpleKCM {
146
155
updateConfig ()
147
156
}
148
157
currentIndex: getIndex (model, autoLoadConfig .touchingWindow )
158
+ enabled: enabledCheckbox .checked
149
159
}
150
160
151
161
ComboBox {
@@ -157,6 +167,7 @@ KCM.SimpleKCM {
157
167
updateConfig ()
158
168
}
159
169
currentIndex: getIndex (model, autoLoadConfig .floating )
170
+ enabled: enabledCheckbox .checked
160
171
}
161
172
162
173
ComboBox {
@@ -168,6 +179,7 @@ KCM.SimpleKCM {
168
179
updateConfig ()
169
180
}
170
181
currentIndex: getIndex (model, autoLoadConfig .normal )
182
+ enabled: enabledCheckbox .checked
171
183
}
172
184
}
173
185
}
0 commit comments