qml: use Binding in ViewDragAutoScrollHandler

This commit is contained in:
Fatih Uzunoglu 2024-04-05 15:38:33 +03:00 committed by Steve Lhomme
parent 3b27d6fc93
commit 0a71209fa5
1 changed files with 7 additions and 6 deletions

View File

@ -116,9 +116,6 @@ QtObject {
function directionChangedHandler() {
if (direction === ViewDragAutoScrollHandler.Direction.None) {
running = false
if (_scrollBar)
_scrollBar.active = false // TODO: Use Binding Qt >=5.14
} else if (!running) {
let _to
@ -142,10 +139,14 @@ QtObject {
to = _to
running = true
if (_scrollBar)
_scrollBar.active = true // TODO: Use Binding Qt >= 5.14
}
}
readonly property Binding _scrollBarActiveBinding: Binding {
when: !!animation._scrollBar && animation.running
target: animation._scrollBar
property: "active"
value: true
}
}
}