@@ -43,20 +43,35 @@ Item {
4343 property bool dragging: false
4444 property var dragItem: new Object();
4545
46− readonly property bool fuzzyAtYEnd: root.scopesListFlickable.contentY >=
47− (root.scopesListFlickable.contentHeight - root.scopesListFlickable.height) - (autoscroller.dragItem.height)
46+ readonly property bool fuzzyAtYEnd: {
47+ var contentHeight = root.scopesListFlickable.contentHeight
48+ var contentY = root.scopesListFlickable.contentY
49+ var dragItemHeight = dragItem ? autoscroller.dragItem.height : 0
50+ var flickableHeight = root.scopesListFlickable.height
51+
52+ if (!dragItem) {
53+ return true;
54+ } else {
55+ return contentY >= (contentHeight - flickableHeight) - dragItemHeight
56+ }
57+ }
4858
4959 readonly property real bottomBoundary: {
50− (
51− root.scopesListFlickable.visibleArea.heightRatio *
52− root.scopesListFlickable.contentHeight
53− )
54− - (1.5 * dragItem.height)
55− + root.scopesListFlickable.contentY
60+ var contentHeight = root.scopesListFlickable.contentHeight
61+ var contentY = root.scopesListFlickable.contentY
62+ var dragItemHeight = dragItem ? autoscroller.dragItem.height : 0
63+ var heightRatio = root.scopesListFlickable.visibleArea.heightRatio
64+
65+ if (!dragItem) {
66+ return true;
67+ } else {
68+ return (heightRatio * contentHeight) -
69+ (1.5 * dragItemHeight) + contentY
70+ }
5671 }
5772
5873 readonly property int delayMs: 32
59− readonly property real topBoundary: root.scopesListFlickable.contentY + (.5 * dragItem.height)
74+ readonly property real topBoundary: dragItem ? root.scopesListFlickable.contentY + (.5 * dragItem.height) : 0
6075
6176 visible: false
6277 readonly property real maxStep: units.dp(10)
@@ -77,22 +92,21 @@ Item {
7792
7893 Timer {
7994 interval: autoscroller.delayMs
80− running: autoscroller.dragging &&
95+ running: autoscroller.dragItem ? (autoscroller.dragging &&
8196 autoscroller.dragItem.y < autoscroller.topBoundary &&
82− !root.scopesListFlickable.atYBeginning
97+ !root.scopesListFlickable.atYBeginning) : false
8398 repeat: true
8499 onTriggered: {
85100 root.scopesListFlickable.contentY -= autoscroller.stepSize(true);
86101 autoscroller.dragItem.y -= autoscroller.stepSize(true);
87102 }
88−
89103 }
90104
91105 Timer {
92106 interval: autoscroller.delayMs
93− running: autoscroller.dragging &&
107+ running: autoscroller.dragItem ? (autoscroller.dragging &&
94108 autoscroller.dragItem.y >= autoscroller.bottomBoundary &&
95− !autoscroller.fuzzyAtYEnd
109+ !autoscroller.fuzzyAtYEnd) : false
96110 repeat: true
97111 onTriggered: {
98112 root.scopesListFlickable.contentY += autoscroller.stepSize(false);