Changeset View
Changeset View
Standalone View
Standalone View
kcms/mouse/kcm/libinput/main.qml
Show All 38 Lines | 31 | Kirigami.ScrollablePage { | |||
---|---|---|---|---|---|
39 | property alias deviceIndex: deviceSelector.currentIndex | 39 | property alias deviceIndex: deviceSelector.currentIndex | ||
40 | signal changeSignal() | 40 | signal changeSignal() | ||
41 | 41 | | |||
42 | property QtObject device | 42 | property QtObject device | ||
43 | property int deviceCount: backend.deviceCount | 43 | property int deviceCount: backend.deviceCount | ||
44 | 44 | | |||
45 | property bool loading: false | 45 | property bool loading: false | ||
46 | 46 | | |||
47 | enabled: deviceCount > 0 | ||||
48 | | ||||
47 | function resetModel(index) { | 49 | function resetModel(index) { | ||
48 | deviceCount = backend.deviceCount | 50 | deviceCount = backend.deviceCount | ||
49 | formLayout.enabled = deviceCount | 51 | formLayout.enabled = deviceCount | ||
50 | deviceSelector.enabled = deviceCount > 1 | 52 | deviceSelector.enabled = deviceCount > 1 | ||
51 | 53 | | |||
52 | loading = true | 54 | loading = true | ||
53 | if (deviceCount) { | 55 | if (deviceCount) { | ||
54 | device = deviceModel[index] | 56 | device = deviceModel[index] | ||
Show All 12 Lines | 68 | function syncValuesFromBackend() { | |||
67 | loading = true | 69 | loading = true | ||
68 | 70 | | |||
69 | deviceEnabled.load() | 71 | deviceEnabled.load() | ||
70 | leftHanded.load() | 72 | leftHanded.load() | ||
71 | middleEmulation.load() | 73 | middleEmulation.load() | ||
72 | accelSpeed.load() | 74 | accelSpeed.load() | ||
73 | accelProfile.load() | 75 | accelProfile.load() | ||
74 | naturalScroll.load() | 76 | naturalScroll.load() | ||
77 | scrollFactor.load() | ||||
75 | 78 | | |||
76 | loading = false | 79 | loading = false | ||
77 | } | 80 | } | ||
78 | 81 | | |||
79 | Kirigami.FormLayout { | 82 | Kirigami.FormLayout { | ||
80 | id: formLayout | 83 | id: formLayout | ||
81 | enabled: deviceCount | 84 | enabled: deviceCount | ||
82 | 85 | | |||
▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Line(s) | 293 | if (enabled && !root.loading) { | |||
292 | root.changeSignal() | 295 | root.changeSignal() | ||
293 | } | 296 | } | ||
294 | } | 297 | } | ||
295 | 298 | | |||
296 | ToolTip { | 299 | ToolTip { | ||
297 | text: i18nd("kcmmouse", "Touchscreen like scrolling.") | 300 | text: i18nd("kcmmouse", "Touchscreen like scrolling.") | ||
298 | } | 301 | } | ||
299 | } | 302 | } | ||
303 | | ||||
304 | // Scroll Speed aka scroll Factor | ||||
305 | Layouts.GridLayout { | ||||
306 | Kirigami.FormData.label: i18nd("kcm_touchpad", "Scrolling speed:") | ||||
307 | Kirigami.FormData.buddyFor: scrollFactor | ||||
308 | | ||||
309 | columns: 3 | ||||
310 | | ||||
311 | Controls.Slider { | ||||
312 | id: scrollFactor | ||||
313 | | ||||
314 | from: 0 | ||||
315 | to: 14 | ||||
316 | stepSize: 1 | ||||
317 | | ||||
318 | property variant values : [ | ||||
319 | 0.1, | ||||
320 | 0.3, | ||||
321 | 0.5, | ||||
322 | 0.75, | ||||
323 | 1, // default | ||||
324 | 1.5, | ||||
325 | 2, | ||||
326 | 3, | ||||
327 | 4, | ||||
328 | 5, | ||||
329 | 7, | ||||
330 | 9, | ||||
331 | 12, | ||||
332 | 15, | ||||
333 | 20 | ||||
ervin: nitpick: I'd put the closing square bracket on the next line and you can drop the semicolumn | |||||
334 | ] | ||||
335 | | ||||
336 | Layouts.Layout.columnSpan: 3 | ||||
337 | | ||||
338 | function load() { | ||||
339 | let index = values.indexOf(device.scrollFactor) | ||||
340 | if (index === -1) { | ||||
341 | index = values.indexOf(1); | ||||
342 | } | ||||
343 | value = index | ||||
ervin: You can drop the semicolumn in there | |||||
344 | } | ||||
345 | | ||||
346 | onMoved: { | ||||
ervin: ditto | |||||
347 | device.scrollFactor = values[value] | ||||
348 | root.changeSignal() | ||||
349 | } | ||||
350 | } | ||||
351 | | ||||
352 | //row 2 | ||||
353 | Controls.Label { | ||||
354 | text: i18nc("Slower Scroll", "Slower") | ||||
355 | } | ||||
356 | Item { | ||||
357 | Layouts.Layout.fillWidth: true | ||||
358 | } | ||||
359 | Controls.Label { | ||||
360 | text: i18nc("Faster Scroll Speed", "Faster") | ||||
361 | } | ||||
362 | } | ||||
300 | } | 363 | } | ||
301 | } | 364 | } |
nitpick: I'd put the closing square bracket on the next line and you can drop the semicolumn