Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindesktop/package/contents/ui/main.qml
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Line(s) | 203 | RowLayout { | |||
---|---|---|---|---|---|
214 | } | 214 | } | ||
215 | 215 | | |||
216 | QtControls.SpinBox { | 216 | QtControls.SpinBox { | ||
217 | id: osdDuration | 217 | id: osdDuration | ||
218 | 218 | | |||
219 | enabled: osdEnabled.checked | 219 | enabled: osdEnabled.checked | ||
220 | 220 | | |||
221 | from: 0 | 221 | from: 0 | ||
222 | to: 10000 | 222 | to: 10000 | ||
davidedmundson: Generally
onActivated
is better as that is only user changes.
onCurrentIndexChanges has… | |||||
223 | stepSize: 100 | 223 | stepSize: 100 | ||
224 | 224 | | |||
225 | textFromValue: function(value, locale) { return i18n("%1 ms", value)} | 225 | textFromValue: function(value, locale) { return i18n("%1 ms", value)} | ||
226 | 226 | | |||
227 | value: kcm.osdDuration | 227 | value: kcm.osdDuration | ||
228 | 228 | | |||
229 | onValueChanged: kcm.osdDuration = value | 229 | onValueChanged: kcm.osdDuration = value | ||
230 | } | 230 | } | ||
Show All 13 Lines | 240 | QtControls.CheckBox { | |||
244 | 244 | | |||
245 | text: i18n("Show desktop layout indicators") | 245 | text: i18n("Show desktop layout indicators") | ||
246 | 246 | | |||
247 | checked: kcm.osdTextOnly | 247 | checked: kcm.osdTextOnly | ||
248 | 248 | | |||
249 | onCheckedChanged: kcm.osdTextOnly = !checked | 249 | onCheckedChanged: kcm.osdTextOnly = !checked | ||
250 | } | 250 | } | ||
251 | } | 251 | } | ||
252 | | ||||
253 | RowLayout { | ||||
254 | Layout.fillWidth: true | ||||
255 | | ||||
256 | QtControls.CheckBox { | ||||
257 | id: animationEnabled | ||||
258 | | ||||
259 | text: i18n("Show animation when switching:") | ||||
260 | | ||||
261 | checked: kcm.animationsModel.enabled | ||||
262 | | ||||
263 | onCheckedChanged: kcm.animationsModel.enabled = checked | ||||
264 | } | ||||
265 | | ||||
266 | QtControls.ComboBox { | ||||
267 | enabled: animationEnabled.checked | ||||
268 | | ||||
269 | model: kcm.animationsModel | ||||
270 | textRole: "NameRole" | ||||
271 | currentIndex: kcm.animationsModel.currentIndex | ||||
272 | onCurrentIndexChanged: kcm.animationsModel.currentIndex = currentIndex | ||||
273 | } | ||||
274 | | ||||
275 | QtControls.Button { | ||||
276 | enabled: animationEnabled.checked && kcm.animationsModel.currentConfigurable | ||||
277 | | ||||
278 | icon.name: "configure" | ||||
279 | | ||||
280 | onClicked: kcm.configureAnimation() | ||||
281 | } | ||||
282 | | ||||
283 | QtControls.Button { | ||||
284 | enabled: animationEnabled.checked | ||||
285 | | ||||
286 | icon.name: "dialog-information" | ||||
287 | | ||||
288 | onClicked: kcm.showAboutAnimation() | ||||
289 | } | ||||
290 | | ||||
291 | Item { | ||||
292 | Layout.fillWidth: true | ||||
293 | } | ||||
294 | } | ||||
252 | } | 295 | } | ||
253 | } | 296 | } | ||
254 | } | 297 | } | ||
255 | 298 | |
Generally
onActivated
is better as that is only user changes.
onCurrentIndexChanges has quirky issues if you ever make that model load asyncronously or whatever as it constantly rebounds.
Might not occur right now, but worth future proofing.