Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindesktop/package/contents/ui/main.qml
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | 154 | QQC2.SpinBox { | |||
---|---|---|---|---|---|
160 | 160 | | |||
161 | textFromValue: function(value, locale) { return i18np("1 Row", "%1 Rows", value)} | 161 | textFromValue: function(value, locale) { return i18np("1 Row", "%1 Rows", value)} | ||
162 | 162 | | |||
163 | onValueModified: kcm.desktopsModel.rows = value | 163 | onValueModified: kcm.desktopsModel.rows = value | ||
164 | } | 164 | } | ||
165 | } | 165 | } | ||
166 | 166 | | |||
167 | Kirigami.FormLayout { | 167 | Kirigami.FormLayout { | ||
168 | Connections { | | |||
169 | target: kcm | | |||
170 | | ||||
171 | onNavWrapsChanged: navWraps.checked = kcm.navWraps | | |||
172 | | ||||
173 | onOsdEnabledChanged: osdEnabled.checked = kcm.osdEnabled | | |||
174 | onOsdDurationChanged: osdDuration.value = kcm.osdDuration | | |||
175 | onOsdTextOnlyChanged: osdTextOnly.checked = !kcm.osdTextOnly | | |||
176 | } | | |||
177 | 168 | | |||
178 | QQC2.CheckBox { | 169 | QQC2.CheckBox { | ||
179 | id: navWraps | 170 | id: navWraps | ||
180 | 171 | | |||
181 | Kirigami.FormData.label: i18n("Options:") | 172 | Kirigami.FormData.label: i18n("Options:") | ||
182 | 173 | | |||
183 | text: i18n("Navigation wraps around") | 174 | text: i18n("Navigation wraps around") | ||
184 | 175 | enabled: !kcm.virtualDesktopsSettings.isImmutable("rollOverDesktops") | |||
185 | checked: kcm.navWraps | 176 | checked: kcm.virtualDesktopsSettings.rollOverDesktops | ||
186 | 177 | onToggled: kcm.virtualDesktopsSettings.rollOverDesktops = checked | |||
crossi: Consider using onToggled, like other checkbox below. | |||||
187 | onCheckedChanged: kcm.navWraps = checked | | |||
188 | } | 178 | } | ||
189 | 179 | | |||
190 | RowLayout { | 180 | RowLayout { | ||
191 | Layout.fillWidth: true | 181 | Layout.fillWidth: true | ||
192 | 182 | | |||
193 | QQC2.CheckBox { | 183 | QQC2.CheckBox { | ||
194 | id: animationEnabled | 184 | id: animationEnabled | ||
195 | // Let it elide but don't make it push the ComboBox away from it | 185 | // Let it elide but don't make it push the ComboBox away from it | ||
196 | Layout.fillWidth: true | 186 | Layout.fillWidth: true | ||
197 | Layout.maximumWidth: implicitWidth | 187 | Layout.maximumWidth: implicitWidth | ||
198 | 188 | | |||
199 | text: i18n("Show animation when switching:") | 189 | text: i18n("Show animation when switching:") | ||
200 | 190 | | |||
201 | checked: kcm.animationsModel.enabled | 191 | checked: kcm.animationsModel.enabled | ||
202 | 192 | | |||
203 | onCheckedChanged: kcm.animationsModel.enabled = checked | 193 | onToggled: kcm.animationsModel.enabled = checked | ||
204 | } | 194 | } | ||
205 | 195 | | |||
206 | QQC2.ComboBox { | 196 | QQC2.ComboBox { | ||
207 | enabled: animationEnabled.checked | 197 | enabled: animationEnabled.checked | ||
208 | 198 | | |||
209 | model: kcm.animationsModel | 199 | model: kcm.animationsModel | ||
210 | textRole: "NameRole" | 200 | textRole: "NameRole" | ||
211 | currentIndex: kcm.animationsModel.currentIndex | 201 | currentIndex: kcm.animationsModel.currentIndex | ||
Show All 24 Lines | |||||
236 | RowLayout { | 226 | RowLayout { | ||
237 | Layout.fillWidth: true | 227 | Layout.fillWidth: true | ||
238 | 228 | | |||
239 | QQC2.CheckBox { | 229 | QQC2.CheckBox { | ||
240 | id: osdEnabled | 230 | id: osdEnabled | ||
241 | 231 | | |||
242 | text: i18n("Show on-screen display when switching:") | 232 | text: i18n("Show on-screen display when switching:") | ||
243 | 233 | | |||
244 | checked: kcm.osdEnabled | 234 | enabled: !kcm.virtualDesktopsSettings.isImmutable("desktopChangeOsdEnabled") | ||
245 | 235 | | |||
246 | onToggled: kcm.osdEnabled = checked | 236 | checked: kcm.virtualDesktopsSettings.desktopChangeOsdEnabled | ||
237 | | ||||
238 | onToggled: kcm.virtualDesktopsSettings.desktopChangeOsdEnabled = checked | ||||
247 | } | 239 | } | ||
248 | 240 | | |||
249 | QQC2.SpinBox { | 241 | QQC2.SpinBox { | ||
250 | id: osdDuration | 242 | id: osdDuration | ||
251 | 243 | | |||
252 | enabled: osdEnabled.checked | 244 | enabled: osdEnabled.checked && !kcm.virtualDesktopsSettings.isImmutable("popupHideDelay") | ||
253 | 245 | | |||
254 | from: 0 | 246 | from: 0 | ||
255 | to: 10000 | 247 | to: 10000 | ||
256 | stepSize: 100 | 248 | stepSize: 100 | ||
257 | 249 | | |||
258 | textFromValue: function(value, locale) { return i18n("%1 ms", value)} | 250 | textFromValue: function(value, locale) { return i18n("%1 ms", value)} | ||
259 | 251 | | |||
260 | value: kcm.osdDuration | 252 | value: kcm.virtualDesktopsSettings.popupHideDelay | ||
261 | 253 | | |||
262 | onValueChanged: kcm.osdDuration = value | 254 | onValueModified: kcm.virtualDesktopsSettings.popupHideDelay = value | ||
crossi: Consider using onValueModified instead which fires when modified by user. | |||||
263 | } | 255 | } | ||
264 | } | 256 | } | ||
265 | 257 | | |||
266 | RowLayout { | 258 | RowLayout { | ||
267 | Layout.fillWidth: true | 259 | Layout.fillWidth: true | ||
268 | 260 | | |||
269 | Item { | 261 | Item { | ||
270 | width: units.largeSpacing | 262 | width: units.largeSpacing | ||
271 | } | 263 | } | ||
272 | 264 | | |||
273 | QQC2.CheckBox { | 265 | QQC2.CheckBox { | ||
274 | id: osdTextOnly | 266 | id: osdTextOnly | ||
275 | 267 | enabled: osdEnabled.checked && !kcm.virtualDesktopsSettings.isImmutable("textOnly") | |||
276 | enabled: osdEnabled.checked | | |||
277 | | ||||
278 | text: i18n("Show desktop layout indicators") | 268 | text: i18n("Show desktop layout indicators") | ||
279 | 269 | checked: !kcm.virtualDesktopsSettings.textOnly | |||
280 | checked: !kcm.osdTextOnly | 270 | onToggled: kcm.virtualDesktopsSettings.textOnly = !checked | ||
281 | | ||||
282 | onToggled: kcm.osdTextOnly = !checked | | |||
283 | } | 271 | } | ||
284 | } | 272 | } | ||
285 | } | 273 | } | ||
286 | } | 274 | } | ||
287 | } | 275 | } | ||
288 | 276 | |
Consider using onToggled, like other checkbox below.