Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/kcm/libinput/touchpad.qml
Show All 35 Lines | 29 | Kirigami.ScrollablePage { | |||
---|---|---|---|---|---|
36 | property alias deviceIndex: deviceSelector.currentIndex | 36 | property alias deviceIndex: deviceSelector.currentIndex | ||
37 | signal changeSignal() | 37 | signal changeSignal() | ||
38 | 38 | | |||
39 | property QtObject touchpad | 39 | property QtObject touchpad | ||
40 | property int touchpadCount: backend.touchpadCount | 40 | property int touchpadCount: backend.touchpadCount | ||
41 | 41 | | |||
42 | property bool loading: false | 42 | property bool loading: false | ||
43 | 43 | | |||
44 | enabled: touchpadCount > 0 | ||||
45 | | ||||
44 | function resetModel(index) { | 46 | function resetModel(index) { | ||
45 | touchpadCount = backend.touchpadCount | 47 | touchpadCount = backend.touchpadCount | ||
46 | formLayout.enabled = touchpadCount | 48 | formLayout.enabled = touchpadCount | ||
47 | deviceSelector.enabled = touchpadCount > 1 | 49 | deviceSelector.enabled = touchpadCount > 1 | ||
48 | 50 | | |||
49 | loading = true | 51 | loading = true | ||
50 | if (touchpadCount) { | 52 | if (touchpadCount) { | ||
51 | touchpad = deviceModel[index] | 53 | touchpad = deviceModel[index] | ||
Show All 18 Lines | 65 | function syncValuesFromBackend() { | |||
70 | accelSpeed.load() | 72 | accelSpeed.load() | ||
71 | accelProfile.load() | 73 | accelProfile.load() | ||
72 | tapToClick.load() | 74 | tapToClick.load() | ||
73 | tapAndDrag.load() | 75 | tapAndDrag.load() | ||
74 | tapAndDragLock.load() | 76 | tapAndDragLock.load() | ||
75 | multiTap.load() | 77 | multiTap.load() | ||
76 | scrollMethod.load() | 78 | scrollMethod.load() | ||
77 | naturalScroll.load() | 79 | naturalScroll.load() | ||
80 | scrollFactor.load() | ||||
78 | rightClickMethod.load() | 81 | rightClickMethod.load() | ||
79 | middleClickMethod.load() | 82 | middleClickMethod.load() | ||
80 | disableHorizontalScrolling.load() | 83 | disableHorizontalScrolling.load() | ||
81 | 84 | | |||
82 | loading = false | 85 | loading = false | ||
83 | } | 86 | } | ||
84 | 87 | | |||
85 | Kirigami.FormLayout { | 88 | Kirigami.FormLayout { | ||
▲ Show 20 Lines • Show All 505 Lines • ▼ Show 20 Line(s) | 577 | Controls.CheckBox { | |||
591 | hoverEnabled: true | 594 | hoverEnabled: true | ||
592 | Controls.ToolTip { | 595 | Controls.ToolTip { | ||
593 | text: i18nd("kcm_touchpad", "Disable horizontal scrolling") | 596 | text: i18nd("kcm_touchpad", "Disable horizontal scrolling") | ||
594 | visible: parent.hovered | 597 | visible: parent.hovered | ||
595 | delay: 1000 | 598 | delay: 1000 | ||
596 | } | 599 | } | ||
597 | } | 600 | } | ||
598 | 601 | | |||
602 | // Scroll Speed aka scroll Factor | ||||
603 | Layouts.GridLayout { | ||||
604 | Kirigami.FormData.label: i18nd("kcm_touchpad", "Scrolling speed:") | ||||
605 | Kirigami.FormData.buddyFor: scrollFactor | ||||
606 | | ||||
607 | columns: 3 | ||||
davidedmundson: So I can only make it faster?
Is that sensible? | |||||
We can make it slower with a number between 0 and 1. meven: We can make it slower with a number between 0 and 1.
I will need to implement a custom step… | |||||
I suspect that a scroll factor less than 1 may screw up discrete axis values. Not sure whether it might be a problem, though. zzag: I suspect that a scroll factor less than 1 may screw up discrete axis values. Not sure whether… | |||||
My testing went ok with a 0.1 scrollFactor, although not extensive (scroll in XWayland Firefox and in qtcreator Wayland mostly). meven: My testing went ok with a 0.1 scrollFactor, although not extensive (scroll in XWayland Firefox… | |||||
608 | | ||||
609 | Controls.Slider { | ||||
610 | id: scrollFactor | ||||
611 | | ||||
612 | from: 0 | ||||
613 | to: 14 | ||||
614 | stepSize: 1 | ||||
615 | | ||||
Don't use onValueChanged use onMoved then you don't need all of this other logic davidedmundson: Don't use onValueChanged
use onMoved
then you don't need all of this other logic | |||||
616 | property variant values : [ | ||||
617 | 0.1, | ||||
618 | 0.3, | ||||
619 | 0.5, | ||||
620 | 0.75, | ||||
621 | 1, // default | ||||
622 | 1.5, | ||||
623 | 2, | ||||
624 | 3, | ||||
625 | 4, | ||||
626 | 5, | ||||
627 | 7, | ||||
628 | 9, | ||||
629 | 12, | ||||
630 | 15, | ||||
631 | 20 | ||||
ervin: Same comment applies than for mouse | |||||
632 | ] | ||||
633 | | ||||
634 | Layouts.Layout.columnSpan: 3 | ||||
635 | | ||||
636 | function load() { | ||||
637 | let index = values.indexOf(touchpad.scrollFactor) | ||||
638 | if (index === -1) { | ||||
ervin: ditto | |||||
639 | index = values.indexOf(1); | ||||
640 | } | ||||
641 | value = index | ||||
642 | } | ||||
643 | | ||||
644 | onMoved: { | ||||
ervin: ditto | |||||
645 | touchpad.scrollFactor = values[value] | ||||
646 | root.changeSignal() | ||||
647 | } | ||||
648 | } | ||||
649 | | ||||
650 | //row 2 | ||||
651 | Controls.Label { | ||||
652 | text: i18nc("Slower Scroll", "Slower") | ||||
653 | } | ||||
654 | Item { | ||||
655 | Layouts.Layout.fillWidth: true | ||||
656 | } | ||||
657 | Controls.Label { | ||||
658 | text: i18nc("Faster Scroll Speed", "Faster") | ||||
659 | } | ||||
660 | } | ||||
661 | | ||||
599 | Item { | 662 | Item { | ||
600 | Kirigami.FormData.isSection: false | 663 | Kirigami.FormData.isSection: false | ||
601 | } | 664 | } | ||
602 | 665 | | |||
603 | Layouts.ColumnLayout { | 666 | Layouts.ColumnLayout { | ||
604 | Kirigami.FormData.label: i18nd("kcm_touchpad", "Right-click:") | 667 | Kirigami.FormData.label: i18nd("kcm_touchpad", "Right-click:") | ||
605 | Kirigami.FormData.buddyFor: rightClickMethodAreas | 668 | Kirigami.FormData.buddyFor: rightClickMethodAreas | ||
606 | id: rightClickMethod | 669 | id: rightClickMethod | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |
So I can only make it faster?
Is that sensible?