[vlc-commits] [Git][videolan/vlc][master] qml: ViewDragAutoScrollHandler don't scroll backward at beginning or forward at end
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Mon Feb 20 14:47:49 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
1aab2c6c by Fatih Uzunoglu at 2023-02-20T14:35:38+00:00
qml: ViewDragAutoScrollHandler don't scroll backward at beginning or forward at end
- - - - -
1 changed file:
- modules/gui/qt/util/qml/ViewDragAutoScrollHandler.qml
Changes:
=====================================
modules/gui/qt/util/qml/ViewDragAutoScrollHandler.qml
=====================================
@@ -71,22 +71,30 @@ QtObject {
root.dragItem.x,
root.dragItem.y)
- var size, mark
+ var size, mark, atBeginning, atEnd
if (root.orientation === Qt.Vertical) {
size = root.view.height
mark = pos.y
+
+ atBeginning = root.view.atYBeginning
+ atEnd = root.view.atYEnd
} else {
size = root.view.width
mark = pos.x
+
+ atBeginning = root.view.atXBeginning
+ atEnd = root.view.atXEnd
}
if (size < root.margin * 2.5)
return ViewDragAutoScrollHandler.Direction.None
if (mark < root.margin)
- return ViewDragAutoScrollHandler.Direction.Backward
+ return !atBeginning ? ViewDragAutoScrollHandler.Direction.Backward
+ : ViewDragAutoScrollHandler.Direction.None
else if (mark > (size - root.margin))
- return ViewDragAutoScrollHandler.Direction.Forward
+ return !atEnd ? ViewDragAutoScrollHandler.Direction.Forward
+ : ViewDragAutoScrollHandler.Direction.None
else
return ViewDragAutoScrollHandler.Direction.None
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1aab2c6c62dedccdf79b846056faf699e37ed230
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1aab2c6c62dedccdf79b846056faf699e37ed230
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list