Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/kcm/libinput/main.qml
Show All 15 Lines | |||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 | ||
20 | import QtQuick.Controls 1.4 as Controls | 20 | import QtQuick.Controls 1.4 as Controls | ||
21 | import QtQuick.Layouts 1.3 as Layouts | 21 | import QtQuick.Layouts 1.3 as Layouts | ||
22 | import QtQuick.Controls.Styles 1.4 as Styles | 22 | import QtQuick.Controls.Styles 1.4 as Styles | ||
23 | 23 | | |||
24 | import org.kde.kcm 1.1 as KCM | ||||
25 | import org.kde.kirigami 2.4 as Kirigami | ||||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 26 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | 27 | | |||
26 | import "components" | 28 | import "components" | ||
27 | 29 | | |||
28 | Item { | 30 | Kirigami.ScrollablePage { | ||
29 | id: root | 31 | id: root | ||
30 | 32 | | |||
31 | property size sizeHint: Qt.size(maincol.width, maincol.height) | 33 | implicitWidth: Kirigami.Units.gridUnit * 20 | ||
32 | property size minimumSizeHint: Qt.size(maincol.width/2, deviceSelector.height) | 34 | implicitHeight: Math.min(flickable.contentHeight, Kirigami.Units.gridUnit * 20) | ||
35 | | ||||
33 | property alias deviceIndex: deviceSelector.currentIndex | 36 | property alias deviceIndex: deviceSelector.currentIndex | ||
34 | signal changeSignal() | 37 | signal changeSignal() | ||
35 | 38 | | |||
36 | property QtObject touchpad | 39 | property QtObject touchpad | ||
37 | property int touchpadCount: backend.touchpadCount | 40 | property int touchpadCount: backend.touchpadCount | ||
38 | 41 | | |||
39 | property bool loading: false | 42 | property bool loading: false | ||
40 | 43 | | |||
41 | function resetModel(index) { | 44 | function resetModel(index) { | ||
42 | touchpadCount = backend.touchpadCount | 45 | touchpadCount = backend.touchpadCount | ||
43 | maincol.enabled = touchpadCount | 46 | formLayout.enabled = touchpadCount | ||
44 | deviceSelector.enabled = touchpadCount > 1 | 47 | deviceSelector.enabled = touchpadCount > 1 | ||
45 | 48 | | |||
46 | loading = true | 49 | loading = true | ||
47 | if (touchpadCount) { | 50 | if (touchpadCount) { | ||
48 | touchpad = deviceModel[index] | 51 | touchpad = deviceModel[index] | ||
49 | deviceSelector.model = deviceModel | 52 | deviceSelector.model = deviceModel | ||
50 | deviceSelector.currentIndex = index | 53 | deviceSelector.currentIndex = index | ||
51 | console.log("Touchpad configuration of device '" + | 54 | console.log("Touchpad configuration of device '" + | ||
Show All 22 Lines | 63 | function syncValuesFromBackend() { | |||
74 | scrollmethod.load() | 77 | scrollmethod.load() | ||
75 | naturalScroll.load() | 78 | naturalScroll.load() | ||
76 | // TODO: | 79 | // TODO: | ||
77 | // scrollbutton.load() | 80 | // scrollbutton.load() | ||
78 | 81 | | |||
79 | loading = false | 82 | loading = false | ||
80 | } | 83 | } | ||
81 | 84 | | |||
82 | Controls.ScrollView { | 85 | Kirigami.FormLayout { | ||
83 | anchors.fill: parent | 86 | id: formLayout | ||
84 | | ||||
85 | Layouts.ColumnLayout { | | |||
86 | id: maincol | | |||
87 | enabled: touchpadCount | | |||
88 | spacing: units.largeSpacing | | |||
89 | | ||||
90 | Layouts.RowLayout { | | |||
91 | spacing: units.largeSpacing | | |||
92 | Layouts.Layout.leftMargin: 0.1 * parent.width | | |||
93 | Layouts.Layout.rightMargin: 0.1 * parent.width | | |||
94 | | ||||
95 | Controls.Label { | | |||
96 | text: i18n("Device:") | | |||
97 | } | | |||
98 | 87 | | |||
88 | // Device | ||||
99 | Controls.ComboBox { | 89 | Controls.ComboBox { | ||
90 | Kirigami.FormData.label: i18n("Device:") | ||||
100 | id: deviceSelector | 91 | id: deviceSelector | ||
101 | enabled: touchpadCount > 1 | 92 | enabled: touchpadCount > 1 | ||
102 | Layouts.Layout.fillWidth: true | 93 | //Layouts.Layout.fillWidth: true | ||
furkantokac: This will go if nobody tells me it is necessary. I couldn't find any use case that this will be… | |||||
94 | implicitWidth: units.gridUnit * 10 | ||||
103 | model: deviceModel | 95 | model: deviceModel | ||
104 | textRole: "name" | 96 | textRole: "name" | ||
105 | 97 | | |||
106 | onCurrentIndexChanged: { | 98 | onCurrentIndexChanged: { | ||
107 | if (touchpadCount) { | 99 | if (touchpadCount) { | ||
108 | touchpad = deviceModel[currentIndex] | 100 | touchpad = deviceModel[currentIndex] | ||
109 | if (!loading) { | 101 | if (!loading) { | ||
110 | changeSignal() | 102 | changeSignal() | ||
111 | } | 103 | } | ||
I'm against this change for several reasons:
romangg: I'm against this change for several reasons:
* In general control elements shouldn't be… | |||||
112 | console.log("Touchpad configuration of device '" + | 104 | console.log("Touchpad configuration of device '" + | ||
113 | (currentIndex+1) + " : " + touchpad.name + "' opened") | 105 | (currentIndex+1) + " : " + touchpad.name + "' opened") | ||
114 | } | 106 | } | ||
115 | root.syncValuesFromBackend() | 107 | root.syncValuesFromBackend() | ||
116 | } | 108 | } | ||
117 | } | 109 | } | ||
118 | } | | |||
119 | 110 | | |||
120 | Row { | 111 | Kirigami.Separator { | ||
121 | spacing: units.largeSpacing * 2 | 112 | } | ||
122 | | ||||
123 | Column { | | |||
124 | spacing: units.smallSpacing * 2 | | |||
125 | 113 | | |||
126 | Column { | 114 | // General settings | ||
127 | leftPadding: units.smallSpacing | | |||
128 | Column { | | |||
129 | spacing: units.smallSpacing | | |||
130 | Controls.Label { | | |||
131 | text: i18n("General settings:") | | |||
132 | } | | |||
133 | | ||||
134 | Column { | | |||
135 | leftPadding: units.smallSpacing | | |||
136 | Column { | | |||
137 | spacing: units.smallSpacing | | |||
138 | Controls.CheckBox { | 115 | Controls.CheckBox { | ||
116 | Kirigami.FormData.label: i18n("General settings:") | ||||
139 | id: deviceEnabled | 117 | id: deviceEnabled | ||
140 | text: i18n("Device enabled") | 118 | text: i18n("Device enabled") | ||
141 | 119 | | |||
142 | function load() { | 120 | function load() { | ||
143 | if (!maincol.enabled) { | 121 | if (!formLayout.enabled) { | ||
144 | checked = false | 122 | checked = false | ||
145 | return | 123 | return | ||
146 | } | 124 | } | ||
147 | enabled = touchpad.supportsDisableEvents | 125 | enabled = touchpad.supportsDisableEvents | ||
148 | checked = enabled && touchpad.enabled | 126 | checked = enabled && touchpad.enabled | ||
149 | } | 127 | } | ||
150 | 128 | | |||
151 | onCheckedChanged: { | 129 | onCheckedChanged: { | ||
152 | if (enabled && !root.loading) { | 130 | if (enabled && !root.loading) { | ||
153 | touchpad.enabled = checked | 131 | touchpad.enabled = checked | ||
154 | root.changeSignal() | 132 | root.changeSignal() | ||
155 | } | 133 | } | ||
156 | } | 134 | } | ||
157 | 135 | | |||
158 | ToolTip { | 136 | ToolTip { | ||
159 | text: i18n("Accept input through this device.") | 137 | text: i18n("Accept input through this device.") | ||
160 | } | 138 | } | ||
161 | } | 139 | } | ||
162 | 140 | | |||
163 | Controls.CheckBox { | 141 | Controls.CheckBox { | ||
164 | id: dwt | 142 | id: dwt | ||
165 | text: i18n("Disable while typing") | 143 | text: i18n("Disable while typing") | ||
166 | 144 | | |||
167 | function load() { | 145 | function load() { | ||
168 | if (!maincol.enabled) { | 146 | if (!formLayout.enabled) { | ||
169 | checked = false | 147 | checked = false | ||
170 | return | 148 | return | ||
171 | } | 149 | } | ||
172 | enabled = touchpad.supportsDisableWhileTyping | 150 | enabled = touchpad.supportsDisableWhileTyping | ||
173 | checked = enabled && touchpad.disableWhileTyping | 151 | checked = enabled && touchpad.disableWhileTyping | ||
174 | } | 152 | } | ||
175 | 153 | | |||
176 | onCheckedChanged: { | 154 | onCheckedChanged: { | ||
177 | if (enabled && !root.loading) { | 155 | if (enabled && !root.loading) { | ||
178 | touchpad.disableWhileTyping = checked | 156 | touchpad.disableWhileTyping = checked | ||
179 | root.changeSignal() | 157 | root.changeSignal() | ||
180 | } | 158 | } | ||
181 | } | 159 | } | ||
182 | 160 | | |||
183 | ToolTip { | 161 | ToolTip { | ||
184 | text: i18n("Disable touchpad while typing to prevent accidental inputs.") | 162 | text: i18n("Disable touchpad while typing to prevent accidental inputs.") | ||
185 | } | 163 | } | ||
186 | } | 164 | } | ||
187 | 165 | | |||
188 | Controls.CheckBox { | 166 | Controls.CheckBox { | ||
189 | id: leftHanded | 167 | id: leftHanded | ||
190 | text: i18n("Left handed mode") | 168 | text: i18n("Left handed mode") | ||
191 | 169 | | |||
192 | function load() { | 170 | function load() { | ||
193 | if (!maincol.enabled) { | 171 | if (!formLayout.enabled) { | ||
194 | checked = false | 172 | checked = false | ||
195 | return | 173 | return | ||
196 | } | 174 | } | ||
197 | enabled = touchpad.supportsLeftHanded | 175 | enabled = touchpad.supportsLeftHanded | ||
198 | checked = enabled && touchpad.leftHanded | 176 | checked = enabled && touchpad.leftHanded | ||
199 | } | 177 | } | ||
200 | 178 | | |||
201 | onCheckedChanged: { | 179 | onCheckedChanged: { | ||
202 | if (enabled && !root.loading) { | 180 | if (enabled && !root.loading) { | ||
203 | touchpad.leftHanded = checked | 181 | touchpad.leftHanded = checked | ||
204 | root.changeSignal() | 182 | root.changeSignal() | ||
205 | } | 183 | } | ||
206 | } | 184 | } | ||
207 | 185 | | |||
208 | ToolTip { | 186 | ToolTip { | ||
209 | text: i18n("Swap left and right buttons.") | 187 | text: i18n("Swap left and right buttons.") | ||
210 | } | 188 | } | ||
211 | } | 189 | } | ||
212 | 190 | | |||
213 | Controls.CheckBox { | 191 | Controls.CheckBox { | ||
214 | id: middleEmulation | 192 | id: middleEmulation | ||
215 | text: i18n("Emulate middle button") | 193 | text: i18n("Emulate middle button") | ||
ngraham: "Press left and right buttons for middle click" | |||||
216 | 194 | | |||
217 | function load() { | 195 | function load() { | ||
218 | if (!maincol.enabled) { | 196 | if (!formLayout.enabled) { | ||
219 | checked = false | 197 | checked = false | ||
220 | return | 198 | return | ||
221 | } | 199 | } | ||
222 | enabled = touchpad.supportsMiddleEmulation | 200 | enabled = touchpad.supportsMiddleEmulation | ||
223 | checked = enabled && touchpad.middleEmulation | 201 | checked = enabled && touchpad.middleEmulation | ||
224 | } | 202 | } | ||
225 | 203 | | |||
226 | onCheckedChanged: { | 204 | onCheckedChanged: { | ||
227 | if (enabled && !root.loading) { | 205 | if (enabled && !root.loading) { | ||
228 | touchpad.middleEmulation = checked | 206 | touchpad.middleEmulation = checked | ||
229 | root.changeSignal() | 207 | root.changeSignal() | ||
230 | } | 208 | } | ||
231 | } | 209 | } | ||
232 | 210 | | |||
233 | ToolTip { | 211 | ToolTip { | ||
234 | text: i18n("Clicking left and right button simultaneously sends middle button click.") | 212 | text: i18n("Clicking left and right button simultaneously sends middle button click.") | ||
235 | } | 213 | } | ||
236 | } | 214 | } | ||
237 | } | | |||
238 | } | | |||
239 | } | | |||
240 | } | | |||
241 | 215 | | |||
242 | Column { | 216 | Kirigami.Separator { | ||
243 | leftPadding: units.smallSpacing | | |||
244 | Column { | | |||
245 | spacing: units.smallSpacing | | |||
246 | Controls.Label { | | |||
247 | text: i18n("Acceleration:") | | |||
248 | } | 217 | } | ||
249 | 218 | | |||
250 | Column { | 219 | // Acceleration | ||
251 | leftPadding: units.smallSpacing | | |||
252 | Column { | | |||
253 | spacing: units.smallSpacing * 2 | | |||
254 | | ||||
255 | Row { | | |||
256 | Controls.Slider { | 220 | Controls.Slider { | ||
221 | Kirigami.FormData.label: i18n("Acceleration:") | ||||
257 | id: accelSpeed | 222 | id: accelSpeed | ||
258 | anchors.verticalCenter: parent.verticalCenter | | |||
259 | 223 | | |||
260 | tickmarksEnabled: true | 224 | tickmarksEnabled: true | ||
261 | 225 | | |||
262 | minimumValue: 1 | 226 | minimumValue: 1 | ||
263 | maximumValue: 10 | 227 | maximumValue: 10 | ||
264 | stepSize: 1 | 228 | stepSize: 1 | ||
265 | 229 | | |||
266 | implicitWidth: units.gridUnit * 9 | 230 | implicitWidth: units.gridUnit * 9 | ||
Show All 11 Lines | |||||
278 | onValueChanged: { | 242 | onValueChanged: { | ||
279 | if (touchpad != undefined && enabled && !root.loading) { | 243 | if (touchpad != undefined && enabled && !root.loading) { | ||
280 | // transform slider range [1, 10] to libinput's pointer acceleration range [-1, 1] | 244 | // transform slider range [1, 10] to libinput's pointer acceleration range [-1, 1] | ||
281 | touchpad.pointerAcceleration = Math.round( (value - 5.5) / 4.5 * 100 ) / 100 | 245 | touchpad.pointerAcceleration = Math.round( (value - 5.5) / 4.5 * 100 ) / 100 | ||
282 | root.changeSignal() | 246 | root.changeSignal() | ||
283 | } | 247 | } | ||
284 | } | 248 | } | ||
285 | } | 249 | } | ||
286 | } | | |||
287 | 250 | | |||
288 | ExclGroupBox { | 251 | ExclGroupBox { | ||
252 | Kirigami.FormData.label: i18n("Acceleration Profile:") | ||||
289 | id: accelProfile | 253 | id: accelProfile | ||
290 | label: i18n("Acceleration Profile:") | | |||
291 | model: [i18n("Flat"), i18n("Adaptive")] | 254 | model: [i18n("Flat"), i18n("Adaptive")] | ||
292 | 255 | | |||
293 | function load() { | 256 | function load() { | ||
294 | enabled = touchpad.supportsPointerAccelerationProfileAdaptive | 257 | enabled = touchpad.supportsPointerAccelerationProfileAdaptive | ||
295 | 258 | | |||
296 | if (!enabled) { | 259 | if (!enabled) { | ||
297 | itemAt(0).checked = false | 260 | itemAt(0).checked = false | ||
298 | itemAt(1).checked = false | 261 | itemAt(1).checked = false | ||
Show All 10 Lines | |||||
309 | onCurrentChanged: { | 272 | onCurrentChanged: { | ||
310 | if (enabled && !root.loading) { | 273 | if (enabled && !root.loading) { | ||
311 | touchpad.pointerAccelerationProfileFlat = itemAt(0).checked | 274 | touchpad.pointerAccelerationProfileFlat = itemAt(0).checked | ||
312 | touchpad.pointerAccelerationProfileAdaptive = itemAt(1).checked | 275 | touchpad.pointerAccelerationProfileAdaptive = itemAt(1).checked | ||
313 | root.changeSignal() | 276 | root.changeSignal() | ||
314 | } | 277 | } | ||
315 | } | 278 | } | ||
316 | } | 279 | } | ||
317 | } | | |||
318 | } | | |||
319 | } | | |||
320 | } | | |||
321 | 280 | | |||
322 | Column { | 281 | Kirigami.Separator { | ||
323 | leftPadding: units.smallSpacing | | |||
324 | Column { | | |||
325 | spacing: units.smallSpacing | | |||
326 | Controls.Label { | | |||
327 | text: i18n("Tapping:") | | |||
328 | } | 282 | } | ||
329 | 283 | | |||
330 | Column { | 284 | // Tapping | ||
331 | leftPadding: units.smallSpacing | | |||
332 | Column { | | |||
333 | spacing: units.smallSpacing | | |||
334 | Controls.CheckBox { | 285 | Controls.CheckBox { | ||
286 | Kirigami.FormData.label: i18n("Tapping:") | ||||
335 | id: tapToClick | 287 | id: tapToClick | ||
336 | text: i18n("Tap-to-click") | 288 | text: i18n("Tap-to-click") | ||
337 | 289 | | |||
338 | function load() { | 290 | function load() { | ||
339 | enabled = touchpad.tapFingerCount > 0 | 291 | enabled = touchpad.tapFingerCount > 0 | ||
340 | checked = enabled && touchpad.tapToClick | 292 | checked = enabled && touchpad.tapToClick | ||
341 | } | 293 | } | ||
342 | 294 | | |||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 354 | if (enabled && !root.loading) { | |||
404 | root.changeSignal() | 356 | root.changeSignal() | ||
405 | } | 357 | } | ||
406 | } | 358 | } | ||
407 | 359 | | |||
408 | ToolTip { | 360 | ToolTip { | ||
409 | text: i18n("Dragging continues after a short finger lift.") | 361 | text: i18n("Dragging continues after a short finger lift.") | ||
410 | } | 362 | } | ||
411 | } | 363 | } | ||
412 | } | | |||
413 | } | | |||
414 | } | | |||
415 | } | | |||
416 | } | | |||
417 | 364 | | |||
418 | Column { | | |||
419 | spacing: units.smallSpacing * 2 | | |||
420 | | ||||
421 | Column { | | |||
422 | leftPadding: units.smallSpacing | | |||
423 | Column { | | |||
424 | leftPadding: units.smallSpacing | | |||
425 | ExclGroupBox { | 365 | ExclGroupBox { | ||
366 | Kirigami.FormData.label: i18n("Multi tapping:") | ||||
426 | id: multiTap | 367 | id: multiTap | ||
427 | label: i18n("Multi tapping:") | | |||
428 | 368 | | |||
429 | function load() { | 369 | function load() { | ||
430 | enabled = touchpad.supportsLmrTapButtonMap && tapToClick.checked | 370 | enabled = touchpad.supportsLmrTapButtonMap && tapToClick.checked | ||
431 | if (touchpad.tapFingerCount > 2) { | 371 | if (touchpad.tapFingerCount > 2) { | ||
432 | model = [i18n("Two-tap right, three middle"), i18n("Two-tap middle, three right")] | 372 | model = [i18n("Two-tap right, three middle"), i18n("Two-tap middle, three right")] | ||
ngraham: "Two finger tap to right-click; three finger tap to middle-click" | |||||
433 | itemAt(0).tooltiptext = i18n("Tap with two fingers triggers a right click, tap with three fingers a middle click.") | 373 | itemAt(0).tooltiptext = i18n("Tap with two fingers triggers a right click, tap with three fingers a middle click.") | ||
ngraham: "Two finger tap to middle-click; three finger tap to right-click" | |||||
434 | itemAt(1).tooltiptext = i18n("Tap with two fingers triggers a middle click, tap with three fingers a right click.") | 374 | itemAt(1).tooltiptext = i18n("Tap with two fingers triggers a middle click, tap with three fingers a right click.") | ||
435 | } else { | 375 | } else { | ||
436 | model = [i18n("Two-tap right click"), i18n("Two-tap middle click")] | 376 | model = [i18n("Two-tap right click"), i18n("Two-tap middle click")] | ||
437 | itemAt(0).tooltiptext = i18n("Tap with two fingers triggers a right click.") | 377 | itemAt(0).tooltiptext = i18n("Tap with two fingers triggers a right click.") | ||
438 | itemAt(1).tooltiptext = i18n("Tap with two fingers triggers a middle click.") | 378 | itemAt(1).tooltiptext = i18n("Tap with two fingers triggers a middle click.") | ||
439 | } | 379 | } | ||
440 | 380 | | |||
441 | if (!enabled) { | 381 | if (!enabled) { | ||
442 | itemAt(0).checked = false | 382 | itemAt(0).checked = false | ||
443 | itemAt(1).checked = false | 383 | itemAt(1).checked = false | ||
444 | return | 384 | return | ||
445 | } | 385 | } | ||
446 | var toCheck = touchpad.lmrTapButtonMap ? 1 : 0 | 386 | var toCheck = touchpad.lmrTapButtonMap ? 1 : 0 | ||
447 | itemAt(toCheck).checked = true | 387 | itemAt(toCheck).checked = true | ||
448 | } | 388 | } | ||
449 | 389 | | |||
450 | onCurrentChanged: { | 390 | onCurrentChanged: { | ||
451 | if (enabled && !root.loading) { | 391 | if (enabled && !root.loading) { | ||
452 | touchpad.lmrTapButtonMap = itemAt(1).checked | 392 | touchpad.lmrTapButtonMap = itemAt(1).checked | ||
453 | root.changeSignal() | 393 | root.changeSignal() | ||
454 | } | 394 | } | ||
455 | } | 395 | } | ||
456 | } | 396 | } | ||
457 | } | | |||
458 | } | | |||
459 | 397 | | |||
460 | Column { | 398 | Kirigami.Separator { | ||
461 | leftPadding: units.smallSpacing | | |||
462 | Column { | | |||
463 | spacing: units.smallSpacing | | |||
464 | Controls.Label { | | |||
465 | text: i18n("Scrolling:") | | |||
466 | } | 399 | } | ||
467 | 400 | | |||
468 | Column { | 401 | // Scrolling | ||
469 | leftPadding: units.smallSpacing | | |||
470 | Column { | | |||
471 | spacing: units.smallSpacing | | |||
472 | ExclGroupBox { | 402 | ExclGroupBox { | ||
403 | Kirigami.FormData.label: i18n("Scroll method:") | ||||
473 | id: scrollmethod | 404 | id: scrollmethod | ||
474 | label: i18n("Scroll method:") | | |||
475 | model: [i18n("Two fingers"), i18n("Touchpad edges"), /*i18n("On Button down"),*/ i18n("No scroll")] | 405 | model: [i18n("Two fingers"), i18n("Touchpad edges"), /*i18n("On Button down"),*/ i18n("No scroll")] | ||
476 | 406 | | |||
477 | property bool isNoScroll: true | 407 | property bool isNoScroll: true | ||
478 | 408 | | |||
479 | function load() { | 409 | function load() { | ||
480 | itemAt(0).enabled = touchpad.supportsScrollTwoFinger | 410 | itemAt(0).enabled = touchpad.supportsScrollTwoFinger | ||
481 | itemAt(1).enabled = touchpad.supportsScrollEdge | 411 | itemAt(1).enabled = touchpad.supportsScrollEdge | ||
482 | // TODO: | 412 | // TODO: | ||
483 | // itemAt(2).enabled = touchpad.supportsScrollOnButtonDown | 413 | // itemAt(2).enabled = touchpad.supportsScrollOnButtonDown | ||
484 | 414 | | |||
485 | var toCheck = 2 | 415 | var toCheck = 2 | ||
486 | if (itemAt(0).enabled && touchpad.scrollTwoFinger) { | 416 | if (itemAt(0).enabled && touchpad.scrollTwoFinger) { | ||
487 | toCheck = 0 | 417 | toCheck = 0 | ||
488 | } else if (itemAt(1).enabled && touchpad.scrollEdge) { | 418 | } else if (itemAt(1).enabled && touchpad.scrollEdge) { | ||
489 | toCheck = 1 | 419 | toCheck = 1 | ||
490 | // } else if (itemAt(2).enabled && touchpad.scrollOnButtonDown) { | 420 | // } else if (itemAt(2).enabled && touchpad.scrollOnButtonDown) { | ||
491 | // toCheck = 2 | 421 | // toCheck = 2 | ||
492 | } | 422 | } | ||
493 | itemAt(0).tooltiptext = i18n("Slide with two fingers scrolls.") | 423 | itemAt(0).tooltiptext = i18n("Slide with two fingers scrolls.") | ||
494 | itemAt(1).tooltiptext = i18n("Slide on the touchpad edges scrolls.") | 424 | itemAt(1).tooltiptext = i18n("Slide on the touchpad edges scrolls.") | ||
495 | itemAt(2).tooltiptext = i18n("All forms of touchpad scrolling are deactivated.") | 425 | itemAt(2).tooltiptext = i18n("All forms of touchpad scrolling are deactivated.") | ||
496 | 426 | | |||
497 | isNoScroll = (toCheck == 2) | 427 | isNoScroll = (toCheck == 2) | ||
498 | itemAt(toCheck).checked = maincol.enabled | 428 | itemAt(toCheck).checked = formLayout.enabled | ||
499 | } | 429 | } | ||
500 | 430 | | |||
501 | onCurrentChanged: { | 431 | onCurrentChanged: { | ||
502 | if (enabled && !root.loading) { | 432 | if (enabled && !root.loading) { | ||
503 | touchpad.scrollTwoFinger = itemAt(0).checked | 433 | touchpad.scrollTwoFinger = itemAt(0).checked | ||
504 | touchpad.scrollEdge = itemAt(1).checked | 434 | touchpad.scrollEdge = itemAt(1).checked | ||
505 | // touchpad.scrollOnButtonDown = itemAt(2).checked | 435 | // touchpad.scrollOnButtonDown = itemAt(2).checked | ||
506 | root.changeSignal() | 436 | root.changeSignal() | ||
507 | } | 437 | } | ||
508 | isNoScroll = itemAt(2).checked | 438 | isNoScroll = itemAt(2).checked | ||
Idea: change this string to:
This might help improve discoverability for people who are familiar with the term "Natural scrolling", which is used by Apple and GNOME. ngraham: Idea: change this string to:
> Invert scroll direction ("Natural scrolling")
This might help… | |||||
509 | loading = true | 439 | loading = true | ||
510 | naturalScroll.load() | 440 | naturalScroll.load() | ||
511 | loading = false | 441 | loading = false | ||
512 | } | 442 | } | ||
513 | } | 443 | } | ||
514 | 444 | | |||
515 | Controls.CheckBox { | 445 | Controls.CheckBox { | ||
516 | id: naturalScroll | 446 | id: naturalScroll | ||
Show All 10 Lines | 455 | if (enabled && !root.loading) { | |||
527 | root.changeSignal() | 457 | root.changeSignal() | ||
528 | } | 458 | } | ||
529 | } | 459 | } | ||
530 | 460 | | |||
531 | ToolTip { | 461 | ToolTip { | ||
532 | text: i18n("Touchscreen like scrolling.") | 462 | text: i18n("Touchscreen like scrolling.") | ||
533 | } | 463 | } | ||
534 | } | 464 | } | ||
535 | } | 465 | } // END Kirigami.FormLayout | ||
536 | } | 466 | } // END KCM.SimpleKCM | ||
furkantokac: This comment will be changed as "END Kirigami.ScrollablePage" | |||||
537 | } | | |||
538 | } | | |||
539 | } | | |||
540 | } | | |||
541 | } | | |||
542 | } | | |||
543 | } | |
This will go if nobody tells me it is necessary. I couldn't find any use case that this will be important.