Fix clicking on eventList top/bot making it scroll

This commit is contained in:
miruka 2019-09-01 05:16:47 -04:00
parent 6a346264be
commit 24a976e3ee
3 changed files with 7 additions and 4 deletions

View File

@ -54,11 +54,11 @@ FocusScope {
}
Item { id: dragPoint }
Item { id: dragCursor }
DragHandler {
id: dragHandler
target: dragPoint
target: dragCursor
onActiveChanged: {
if (active) {
target.Drag.active = true

View File

@ -44,6 +44,7 @@ Column {
combine ? theme.spacing / 2 :
theme.spacing * 2
Daybreak {
visible: dayBreak
width: eventDelegate.width

View File

@ -13,6 +13,8 @@ Rectangle {
reversed: eventList.verticalLayoutDirection == ListView.BottomToTop
onDragPositionChanged: {
let vel = dragPoint.velocity.y
let boost = 20 * (
dragPosition.y < 50 ?
-dragPosition.y : -(height - dragPosition.y)
@ -20,8 +22,8 @@ Rectangle {
dragFlicker.speed =
dragPosition.x == 0 && dragPosition.y == 0 ? 0 :
dragPosition.y < 50 ? 1000 + boost:
dragPosition.y > height - 50 ? -1000 + -boost :
vel && dragPosition.y < 50 ? 1000 + boost:
vel && dragPosition.y > height - 50 ? -1000 + -boost :
0
}