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 { DragHandler {
id: dragHandler id: dragHandler
target: dragPoint target: dragCursor
onActiveChanged: { onActiveChanged: {
if (active) { if (active) {
target.Drag.active = true target.Drag.active = true

View File

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

View File

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