Changeset View
Changeset View
Standalone View
Standalone View
kcms/workspaceoptions/package/contents/ui/main.qml
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2017 Roman Gilg <subdiff@gmail.com> | ||||
2 | * Copyright 2018 Furkan Tokac <furkantokac34@gmail.com> | 3 | * Copyright 2018 Furkan Tokac <furkantokac34@gmail.com> | ||
3 | * | 4 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | 8 | * (at your option) any later version. | ||
8 | * | 9 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. | ||
13 | * | 14 | * | ||
14 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 18 | */ | ||
19 | | ||||
18 | import QtQuick 2.7 | 20 | import QtQuick 2.7 | ||
19 | import QtQuick.Controls 1.4 as Controls | 21 | import QtQuick.Controls 2.0 as Controls | ||
20 | import QtQuick.Layouts 1.3 as Layouts | 22 | import QtQuick.Layouts 1.3 as Layouts | ||
21 | import org.kde.kirigami 2.4 as Kirigami | | |||
22 | import org.kde.kcm 1.1 as KCM | | |||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.kcm 1.1 as KCM | ||
25 | import org.kde.kirigami 2.4 as Kirigami | ||||
25 | 26 | | |||
26 | KCM.SimpleKCM { | 27 | // TODO: Change ScrollablePage as KCM.SimpleKCM | ||
28 | // after rewrite the KCM in KConfigModule. | ||||
29 | Kirigami.ScrollablePage { | ||||
27 | id: root | 30 | id: root | ||
28 | 31 | | |||
32 | spacing: Kirigami.Units.smallSpacing | ||||
33 | | ||||
34 | property size minimumSizeHint: Qt.size(formLayout.width/2, deviceSelector.height) | ||||
35 | | ||||
36 | property alias deviceIndex: deviceSelector.currentIndex | ||||
37 | signal changeSignal() | ||||
38 | | ||||
39 | property QtObject touchpad | ||||
40 | property int touchpadCount: backend.touchpadCount | ||||
41 | | ||||
42 | property bool loading: false | ||||
43 | | ||||
44 | function resetModel(index) { | ||||
45 | touchpadCount = backend.touchpadCount | ||||
46 | formLayout.enabled = touchpadCount | ||||
47 | deviceSelector.enabled = touchpadCount > 1 | ||||
48 | | ||||
49 | loading = true | ||||
50 | if (touchpadCount) { | ||||
51 | touchpad = deviceModel[index] | ||||
52 | deviceSelector.model = deviceModel | ||||
53 | deviceSelector.currentIndex = index | ||||
54 | console.log("Touchpad configuration of device '" + | ||||
55 | (index + 1) + " : " + touchpad.name + "' opened") | ||||
56 | } else { | ||||
57 | deviceSelector.model = [""] | ||||
58 | console.log("No touchpad found") | ||||
59 | } | ||||
60 | loading = false | ||||
61 | } | ||||
62 | | ||||
63 | function syncValuesFromBackend() { | ||||
64 | loading = true | ||||
65 | | ||||
66 | deviceEnabled.load() | ||||
67 | dwt.load() | ||||
68 | leftHanded.load() | ||||
69 | accelSpeed.load() | ||||
70 | accelProfile.load() | ||||
71 | tapToClick.load() | ||||
72 | tapAndDrag.load() | ||||
73 | tapAndDragLock.load() | ||||
74 | multiTap.load() | ||||
75 | scrollMethod.load() | ||||
76 | naturalScroll.load() | ||||
77 | | ||||
78 | loading = false | ||||
79 | } | ||||
80 | | ||||
29 | Kirigami.FormLayout { | 81 | Kirigami.FormLayout { | ||
30 | id: formLayout | 82 | id: formLayout | ||
31 | 83 | | |||
32 | // Visaul behavior settings | 84 | // Device | ||
85 | Controls.ComboBox { | ||||
86 | Kirigami.FormData.label: i18n("Device:") | ||||
87 | id: deviceSelector | ||||
88 | | ||||
89 | enabled: touchpadCount > 1 | ||||
90 | Layouts.Layout.fillWidth: true | ||||
91 | model: deviceModel | ||||
92 | textRole: "name" | ||||
93 | | ||||
94 | onCurrentIndexChanged: { | ||||
95 | if (touchpadCount) { | ||||
96 | touchpad = deviceModel[currentIndex] | ||||
97 | if (!loading) { | ||||
98 | changeSignal() | ||||
99 | } | ||||
100 | console.log("Touchpad configuration of device '" + | ||||
101 | (currentIndex+1) + " : " + touchpad.name + "' opened") | ||||
102 | } | ||||
103 | root.syncValuesFromBackend() | ||||
104 | } | ||||
105 | } | ||||
106 | | ||||
107 | Kirigami.Separator { | ||||
108 | } | ||||
109 | | ||||
110 | // General settings | ||||
111 | Controls.CheckBox { | ||||
112 | Kirigami.FormData.label: i18n("General:") | ||||
113 | id: deviceEnabled | ||||
114 | text: i18n("Device enabled") | ||||
115 | | ||||
116 | hoverEnabled: true | ||||
117 | Controls.ToolTip { | ||||
118 | text: i18n("Accept input through this device.") | ||||
119 | visible: parent.hovered | ||||
120 | delay: 1000 | ||||
121 | } | ||||
122 | | ||||
123 | function load() { | ||||
124 | if (!formLayout.enabled) { | ||||
125 | checked = false | ||||
126 | return | ||||
127 | } | ||||
128 | enabled = touchpad.supportsDisableEvents | ||||
129 | checked = enabled && touchpad.enabled | ||||
130 | } | ||||
131 | | ||||
132 | onCheckedChanged: { | ||||
133 | if (enabled && !root.loading) { | ||||
134 | touchpad.enabled = checked | ||||
135 | root.changeSignal() | ||||
136 | } | ||||
137 | } | ||||
138 | } | ||||
139 | | ||||
140 | Controls.CheckBox { | ||||
141 | id: dwt | ||||
142 | text: i18n("Disable while typing") | ||||
143 | | ||||
144 | hoverEnabled: true | ||||
145 | Controls.ToolTip { | ||||
146 | text: i18n("Disable touchpad while typing to prevent accidental inputs.") | ||||
147 | visible: parent.hovered | ||||
148 | delay: 1000 | ||||
149 | } | ||||
150 | | ||||
151 | function load() { | ||||
152 | if (!formLayout.enabled) { | ||||
153 | checked = false | ||||
154 | return | ||||
155 | } | ||||
156 | enabled = touchpad.supportsDisableWhileTyping | ||||
157 | checked = enabled && touchpad.disableWhileTyping | ||||
158 | } | ||||
159 | | ||||
160 | onCheckedChanged: { | ||||
161 | if (enabled && !root.loading) { | ||||
162 | touchpad.disableWhileTyping = checked | ||||
163 | root.changeSignal() | ||||
164 | } | ||||
165 | } | ||||
166 | } | ||||
167 | | ||||
168 | Controls.CheckBox { | ||||
169 | id: leftHanded | ||||
170 | text: i18n("Left handed mode") | ||||
171 | | ||||
172 | hoverEnabled: true | ||||
173 | Controls.ToolTip { | ||||
174 | text: i18n("Swap left and right buttons.") | ||||
175 | visible: parent.hovered | ||||
176 | delay: 1000 | ||||
177 | } | ||||
178 | | ||||
179 | function load() { | ||||
180 | if (!formLayout.enabled) { | ||||
181 | checked = false | ||||
182 | return | ||||
183 | } | ||||
184 | enabled = touchpad.supportsLeftHanded | ||||
185 | checked = enabled && touchpad.leftHanded | ||||
186 | } | ||||
187 | | ||||
188 | onCheckedChanged: { | ||||
189 | if (enabled && !root.loading) { | ||||
190 | touchpad.leftHanded = checked | ||||
191 | root.changeSignal() | ||||
192 | } | ||||
193 | } | ||||
194 | } | ||||
195 | | ||||
196 | Controls.CheckBox { | ||||
197 | id: middleEmulation | ||||
198 | text: i18n("Press left and right buttons for middle click") | ||||
199 | | ||||
200 | hoverEnabled: true | ||||
201 | Controls.ToolTip { | ||||
202 | text: i18n("Clicking left and right button simultaneously sends middle button click.") | ||||
203 | visible: parent.hovered | ||||
204 | delay: 1000 | ||||
205 | } | ||||
206 | | ||||
207 | function load() { | ||||
208 | if (!formLayout.enabled) { | ||||
209 | checked = false | ||||
210 | return | ||||
211 | } | ||||
212 | enabled = touchpad.supportsMiddleEmulation | ||||
213 | checked = enabled && touchpad.middleEmulation | ||||
214 | } | ||||
215 | | ||||
216 | onCheckedChanged: { | ||||
217 | if (enabled && !root.loading) { | ||||
218 | touchpad.middleEmulation = checked | ||||
219 | root.changeSignal() | ||||
220 | } | ||||
221 | } | ||||
222 | } | ||||
223 | | ||||
224 | Kirigami.Separator { | ||||
225 | } | ||||
226 | | ||||
227 | // Acceleration | ||||
228 | Controls.Slider { | ||||
229 | Kirigami.FormData.label: i18n("Pointer speed:") | ||||
230 | id: accelSpeed | ||||
231 | | ||||
232 | from: 1 | ||||
233 | to: 11 | ||||
234 | stepSize: 1 | ||||
235 | | ||||
236 | function load() { | ||||
237 | enabled = touchpad.supportsPointerAcceleration | ||||
238 | if (!enabled) { | ||||
239 | value = 0.1 | ||||
240 | return | ||||
241 | } | ||||
242 | // transform libinput's pointer acceleration range [-1, 1] to slider range [1, 11] | ||||
243 | value = 6 + touchpad.pointerAcceleration / 0.2 | ||||
244 | } | ||||
245 | | ||||
246 | onValueChanged: { | ||||
247 | if (touchpad != undefined && enabled && !root.loading) { | ||||
248 | // transform slider range [1, 11] to libinput's pointer acceleration range [-1, 1] | ||||
249 | // by *10 and /10, we ignore the floating points after 1 digit. This prevents from | ||||
250 | // having a libinput value like 0.60000001 | ||||
251 | touchpad.pointerAcceleration = Math.round(((value-6) * 0.2) * 10) / 10 | ||||
252 | root.changeSignal() | ||||
253 | } | ||||
254 | } | ||||
255 | } | ||||
256 | | ||||
257 | Layouts.ColumnLayout { | ||||
258 | Kirigami.FormData.label: i18n("Acceleration profile:") | ||||
259 | Kirigami.FormData.buddyFor: accelProfileFlat | ||||
260 | id: accelProfile | ||||
261 | spacing: Kirigami.Units.smallSpacing | ||||
262 | | ||||
263 | function load() { | ||||
264 | enabled = touchpad.supportsPointerAccelerationProfileAdaptive | ||||
265 | | ||||
266 | if (!enabled) { | ||||
267 | accelProfileFlat.checked = false | ||||
268 | accelProfileAdaptive.checked = false | ||||
269 | return | ||||
270 | } | ||||
271 | | ||||
272 | if(touchpad.pointerAccelerationProfileAdaptive) { | ||||
273 | accelProfileAdaptive.checked = true | ||||
274 | } else { | ||||
275 | accelProfileFlat.checked = true | ||||
276 | } | ||||
277 | } | ||||
278 | | ||||
279 | function syncCurrent() { | ||||
280 | if (enabled && !root.loading) { | ||||
281 | touchpad.pointerAccelerationProfileFlat = accelProfileFlat.checked | ||||
282 | touchpad.pointerAccelerationProfileAdaptive = accelProfileAdaptive.checked | ||||
283 | root.changeSignal() | ||||
284 | } | ||||
285 | } | ||||
286 | | ||||
287 | Controls.RadioButton { | ||||
288 | id: accelProfileFlat | ||||
289 | text: i18n("Flat") | ||||
290 | | ||||
291 | hoverEnabled: true | ||||
292 | Controls.ToolTip { | ||||
293 | text: i18n("Cursor moves the same distance as finger.") | ||||
294 | visible: parent.hovered | ||||
295 | delay: 1000 | ||||
296 | } | ||||
297 | onCheckedChanged: accelProfile.syncCurrent() | ||||
298 | } | ||||
299 | | ||||
300 | Controls.RadioButton { | ||||
301 | id: accelProfileAdaptive | ||||
302 | text: i18n("Adaptive") | ||||
303 | | ||||
304 | hoverEnabled: true | ||||
305 | Controls.ToolTip { | ||||
306 | text: i18n("Cursor travel distance depends on movement speed of finger.") | ||||
307 | visible: parent.hovered | ||||
308 | delay: 1000 | ||||
309 | } | ||||
310 | onCheckedChanged: accelProfile.syncCurrent() | ||||
311 | } | ||||
312 | } | ||||
313 | | ||||
314 | Kirigami.Separator { | ||||
315 | } | ||||
316 | | ||||
317 | // Tapping | ||||
318 | Controls.CheckBox { | ||||
319 | Kirigami.FormData.label: i18n("Tapping:") | ||||
320 | id: tapToClick | ||||
321 | text: i18n("Tap-to-click") | ||||
322 | | ||||
323 | hoverEnabled: true | ||||
324 | Controls.ToolTip { | ||||
325 | text: i18n("Single tap is left button click.") | ||||
326 | visible: parent.hovered | ||||
327 | delay: 1000 | ||||
328 | } | ||||
329 | | ||||
330 | function load() { | ||||
331 | enabled = touchpad.tapFingerCount > 0 | ||||
332 | checked = enabled && touchpad.tapToClick | ||||
333 | } | ||||
334 | | ||||
335 | function updateDependents() { | ||||
336 | loading = true | ||||
337 | tapAndDrag.load() | ||||
338 | tapAndDragLock.load() | ||||
339 | multiTap.load() | ||||
340 | loading = false | ||||
341 | } | ||||
342 | | ||||
343 | onCheckedChanged: { | ||||
344 | if (enabled && !root.loading) { | ||||
345 | touchpad.tapToClick = checked | ||||
346 | updateDependents() | ||||
347 | root.changeSignal() | ||||
348 | } | ||||
349 | } | ||||
350 | } | ||||
351 | | ||||
33 | Controls.CheckBox { | 352 | Controls.CheckBox { | ||
34 | id: showToolTips | 353 | id: tapAndDrag | ||
35 | Kirigami.FormData.label: i18n("Visual behavior:") | 354 | text: i18n("Tap-and-drag") | ||
36 | text: i18n("Display informational tooltips on mouse hover") | 355 | | ||
37 | checked: kcm.toolTip | 356 | hoverEnabled: true | ||
38 | onCheckedChanged: kcm.toolTip = checked | 357 | Controls.ToolTip { | ||
358 | text: i18n("Sliding over touchpad directly after tap drags.") | ||||
359 | visible: parent.hovered | ||||
360 | delay: 1000 | ||||
361 | } | ||||
362 | | ||||
363 | function load() { | ||||
364 | enabled = touchpad.tapFingerCount > 0 && tapToClick.checked | ||||
365 | checked = enabled && touchpad.tapAndDrag | ||||
366 | } | ||||
367 | | ||||
368 | function updateDependents() { | ||||
369 | loading = true | ||||
370 | tapAndDragLock.load() | ||||
371 | loading = false | ||||
372 | } | ||||
373 | | ||||
374 | onCheckedChanged: { | ||||
375 | if (enabled && !root.loading) { | ||||
376 | touchpad.tapAndDrag = checked | ||||
377 | updateDependents() | ||||
378 | root.changeSignal() | ||||
379 | } | ||||
380 | } | ||||
39 | } | 381 | } | ||
40 | 382 | | |||
41 | Controls.CheckBox { | 383 | Controls.CheckBox { | ||
42 | id: showVisualFeedback | 384 | id: tapAndDragLock | ||
43 | text: i18n("Display visual feedback for status changes") | 385 | text: i18n("Tap-and-drag lock") | ||
44 | checked: kcm.visualFeedback | 386 | | ||
45 | onCheckedChanged: kcm.visualFeedback = checked | 387 | hoverEnabled: true | ||
388 | Controls.ToolTip { | ||||
389 | text: i18n("Dragging continues after a short finger lift.") | ||||
390 | visible: parent.hovered | ||||
391 | delay: 1000 | ||||
46 | } | 392 | } | ||
47 | 393 | | |||
48 | Connections { | 394 | function load() { | ||
49 | target: kcm | 395 | enabled = touchpad.tapFingerCount > 0 && tapAndDrag.checked | ||
50 | onToolTipChanged: showToolTips.checked = kcm.toolTip | 396 | checked = enabled && touchpad.tapDragLock | ||
51 | onVisualFeedbackChanged: showVisualFeedback.checked = kcm.visualFeedback | 397 | } | ||
398 | | ||||
399 | onCheckedChanged: { | ||||
400 | if (enabled && !root.loading) { | ||||
401 | touchpad.tapDragLock = checked | ||||
402 | root.changeSignal() | ||||
403 | } | ||||
404 | } | ||||
405 | } | ||||
406 | | ||||
407 | Layouts.ColumnLayout { | ||||
408 | Kirigami.FormData.label: i18n("Two-finger tap:") | ||||
409 | Kirigami.FormData.buddyFor: multiTapRightClick | ||||
410 | id: multiTap | ||||
411 | | ||||
412 | spacing: Kirigami.Units.smallSpacing | ||||
413 | | ||||
414 | function load() { | ||||
415 | enabled = touchpad.supportsLmrTapButtonMap && tapToClick.checked | ||||
416 | if (touchpad.tapFingerCount > 2) { | ||||
417 | multiTapRightClick.text = i18n("Right-click (three-finger tap to middle-click)") | ||||
418 | multiTapRightClickToolTip.text = i18n("Tap with two fingers to right-click, tap with three fingers to middle-click.") | ||||
419 | | ||||
420 | multiTapMiddleClick.text = i18n("Middle-click (three-finger tap right-click)") | ||||
421 | multiTapMiddleClickToolTip.text = i18n("Tap with two fingers to middle-click, tap with three fingers to right-click.") | ||||
422 | } else { | ||||
423 | multiTapRightClick.text = i18n("Righ-click") | ||||
424 | multiTapRightClickToolTip.text = i18n("Tap with two fingers to right-click.") | ||||
425 | | ||||
426 | multiTapMiddleClick.text = i18n("Middle-click") | ||||
427 | multiTapMiddleClickToolTip.text = i18n("Tap with two fingers to middle-click.") | ||||
428 | } | ||||
429 | | ||||
430 | if (!enabled) { | ||||
431 | multiTapRightClick.checked = false | ||||
432 | multiTapMiddleClick.checked = false | ||||
433 | return | ||||
434 | } | ||||
435 | | ||||
436 | if(touchpad.lmrTapButtonMap) { | ||||
437 | multiTapMiddleClick.checked = true | ||||
438 | } else { | ||||
439 | multiTapRightClick.checked = true | ||||
440 | } | ||||
441 | } | ||||
442 | | ||||
443 | function syncCurrent() { | ||||
444 | if (enabled && !root.loading) { | ||||
445 | touchpad.lmrTapButtonMap = multiTapMiddleClick.checked | ||||
446 | root.changeSignal() | ||||
447 | } | ||||
448 | } | ||||
449 | | ||||
450 | Controls.RadioButton { | ||||
451 | id: multiTapRightClick | ||||
452 | // text: is handled dynamically on load. | ||||
453 | | ||||
454 | hoverEnabled: true | ||||
455 | Controls.ToolTip { | ||||
456 | id: multiTapRightClickToolTip | ||||
457 | visible: parent.hovered | ||||
458 | delay: 1000 | ||||
459 | // text: is handled dynamically on load. | ||||
460 | } | ||||
461 | onCheckedChanged: multiTap.syncCurrent() | ||||
462 | } | ||||
463 | | ||||
464 | Controls.RadioButton { | ||||
465 | id: multiTapMiddleClick | ||||
466 | // text: is handled dynamically on load. | ||||
467 | | ||||
468 | hoverEnabled: true | ||||
469 | Controls.ToolTip { | ||||
470 | id: multiTapMiddleClickToolTip | ||||
471 | visible: parent.hovered | ||||
472 | delay: 1000 | ||||
473 | // text: is handled dynamically on load. | ||||
474 | } | ||||
475 | onCheckedChanged: multiTap.syncCurrent() | ||||
476 | } | ||||
52 | } | 477 | } | ||
53 | 478 | | |||
54 | Kirigami.Separator { | 479 | Kirigami.Separator { | ||
55 | } | 480 | } | ||
56 | 481 | | |||
57 | // Click behavior settings | 482 | // Scrolling | ||
58 | Controls.ExclusiveGroup { | 483 | Layouts.ColumnLayout { | ||
59 | id: clickBehaviorGroup | 484 | Kirigami.FormData.label: i18n("Scrolling:") | ||
485 | Kirigami.FormData.buddyFor: scrollMethodTwoFingers | ||||
486 | id: scrollMethod | ||||
487 | | ||||
488 | spacing: Kirigami.Units.smallSpacing | ||||
489 | | ||||
490 | function load() { | ||||
491 | scrollMethodTwoFingers.enabled = touchpad.supportsScrollTwoFinger | ||||
492 | scrollMethodTouchpadEdges.enabled = touchpad.supportsScrollEdge | ||||
493 | | ||||
494 | if(scrollMethodTouchpadEdges.enabled && touchpad.scrollEdge) { | ||||
495 | scrollMethodTouchpadEdges.checked = formLayout.enabled | ||||
496 | } else { | ||||
497 | scrollMethodTwoFingers.checked = formLayout.enabled | ||||
498 | } | ||||
499 | } | ||||
500 | | ||||
501 | function syncCurrent() { | ||||
502 | if (enabled && !root.loading) { | ||||
503 | touchpad.scrollTwoFinger = scrollMethodTwoFingers.checked | ||||
504 | touchpad.scrollEdge = scrollMethodTouchpadEdges.checked | ||||
505 | root.changeSignal() | ||||
506 | } | ||||
507 | loading = true | ||||
508 | naturalScroll.load() | ||||
509 | loading = false | ||||
60 | } | 510 | } | ||
61 | 511 | | |||
62 | Controls.RadioButton { | 512 | Controls.RadioButton { | ||
63 | id: singleClick | 513 | id: scrollMethodTwoFingers | ||
64 | Kirigami.FormData.label: i18n("Click behavior:") | 514 | text: i18n("Two fingers") | ||
65 | text: i18n("Single-click to open files and folders") | 515 | | ||
66 | checked: kcm.singleClick | 516 | hoverEnabled: true | ||
67 | exclusiveGroup: clickBehaviorGroup | 517 | Controls.ToolTip { | ||
68 | onCheckedChanged: kcm.singleClick = checked | 518 | text: i18n("Slide with two fingers scrolls.") | ||
519 | visible: parent.hovered | ||||
520 | delay: 1000 | ||||
521 | } | ||||
69 | } | 522 | } | ||
70 | 523 | | |||
71 | Controls.RadioButton { | 524 | Controls.RadioButton { | ||
72 | id: doubleClick | 525 | id: scrollMethodTouchpadEdges | ||
73 | text: i18n("Double-click to open files and folders (single click to select)") | 526 | text: i18n("Touchpad edges") | ||
74 | exclusiveGroup: clickBehaviorGroup | 527 | | ||
528 | hoverEnabled: true | ||||
529 | Controls.ToolTip { | ||||
530 | text: i18n("Slide on the touchpad edges scrolls.") | ||||
531 | visible: parent.hovered | ||||
532 | delay: 1000 | ||||
533 | } | ||||
534 | onCheckedChanged: scrollMethod.syncCurrent() | ||||
535 | } | ||||
75 | } | 536 | } | ||
76 | 537 | | |||
77 | Connections { | 538 | Controls.CheckBox { | ||
78 | target: kcm | 539 | id: naturalScroll | ||
79 | onSingleClickChanged: { | 540 | text: i18n("Invert scroll direction (Natural scrolling)") | ||
80 | singleClick.checked = kcm.singleClick | 541 | | ||
81 | doubleClick.checked = !singleClick.checked | 542 | function load() { | ||
543 | enabled = touchpad.supportsNaturalScroll | ||||
544 | checked = enabled && touchpad.naturalScroll | ||||
545 | } | ||||
546 | | ||||
547 | onCheckedChanged: { | ||||
548 | if (enabled && !root.loading) { | ||||
549 | touchpad.naturalScroll = checked | ||||
550 | root.changeSignal() | ||||
82 | } | 551 | } | ||
83 | } | 552 | } | ||
553 | | ||||
554 | hoverEnabled: true | ||||
555 | Controls.ToolTip { | ||||
556 | text: i18n("Touchscreen like scrolling.") | ||||
557 | visible: parent.hovered | ||||
558 | delay: 1000 | ||||
84 | } | 559 | } | ||
85 | } | 560 | } | ||
561 | } // END Kirigami.FormLayout | ||||
562 | } // END Kirigami.ScrollablePage |