on xenial help sign in
rejigged order
36732a0Nick Dedekind
qml/Components/ScrollCalculator.qml+8−7
@@ -30,15 +30,21 @@ Item {
30
30
31 signal scroll(real scrollAmount)
31 signal scroll(real scrollAmount)
32
32
33− onAreaActiveChanged: areaActive ? handleEnter() : handleExit()
34−
35 width: units.gu(5)
33 width: units.gu(5)
36 rotation: direction === Qt.LeftToRight ? 0 : 180
34 rotation: direction === Qt.LeftToRight ? 0 : 180
37
35
36+ onAreaActiveChanged: areaActive ? handleEnter() : handleExit()
37+
38 function handleEnter() {
38 function handleEnter() {
39 d.threasholdAreaX = -scrollArea.stopScrollThreshold;
39 d.threasholdAreaX = -scrollArea.stopScrollThreshold;
40 scrollTimer.restart();
40 scrollTimer.restart();
41 }
41 }
42+
43+ function handleExit() {
44+ d.threasholdAreaX = -scrollArea.stopScrollThreshold;
45+ scrollTimer.stop();
46+ }
47+
42 onLateralPositionChanged: {
48 onLateralPositionChanged: {
43 if (scrollArea.areaActive) {
49 if (scrollArea.areaActive) {
44 if (lateralPosition > width * (1 - forceScrollingPercentage)) {
50 if (lateralPosition > width * (1 - forceScrollingPercentage)) {
@@ -56,11 +62,6 @@ Item {
56 }
62 }
57 }
63 }
58
64
59− function handleExit() {
60− d.threasholdAreaX = -scrollArea.stopScrollThreshold;
61− scrollTimer.stop();
62− }
63−
64 Timer {
65 Timer {
65 id: scrollTimer
66 id: scrollTimer
66 interval: 16
67 interval: 16