Fix bug when setting useTrackpadFix option
This commit is contained in:
parent
f72544e3d0
commit
107f928007
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick 2.12
|
||||||
|
|
||||||
// Mouse area model to fix scroll on trackpad
|
// MouseArea component to fix scroll on trackpad
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
enabled: window.settings.useTrackpadFix
|
enabled: window.settings.useTrackpadFix
|
||||||
|
@ -21,6 +21,9 @@ MouseArea {
|
||||||
|
|
||||||
property Flickable flickable: parent
|
property Flickable flickable: parent
|
||||||
|
|
||||||
|
// Used to get default flickDeceleration value
|
||||||
|
readonly property Flickable dummy: Flickable {}
|
||||||
|
|
||||||
|
|
||||||
function getNewPosition(flickable, wheel) {
|
function getNewPosition(flickable, wheel) {
|
||||||
// wheel.pixelDelta will be available on high resolution trackpads.
|
// wheel.pixelDelta will be available on high resolution trackpads.
|
||||||
|
@ -53,7 +56,6 @@ MouseArea {
|
||||||
Binding {
|
Binding {
|
||||||
target: flickable
|
target: flickable
|
||||||
property: "flickDeceleration"
|
property: "flickDeceleration"
|
||||||
value: 8000
|
value: mouseArea.enabled ? 8000.0 : dummy.flickDeceleration
|
||||||
when: mouseArea.enabled
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user