on xenial help sign in
add a timer to pull to refresh to work on small windows (LP: #1589060)
86b4284Andrea Cimitan
qml/Dash/GenericScopeView.qml+1−1
@@ -733,7 +733,7 @@ FocusScope {
733
733
734 style: PullToRefreshScopeStyle {
734 style: PullToRefreshScopeStyle {
735 anchors.fill: parent
735 anchors.fill: parent
736− activationThreshold: units.gu(14)
736+ activationThreshold: Math.min(units.gu(14), scopeView.height / 5)
737 }
737 }
738 }
738 }
739 }
739 }
tests/qmltests/Dash/tst_GenericScopeView.qml+28
@@ -583,6 +583,34 @@ Item {
583
583
584 spy.wait()
584 spy.wait()
585 compare(spy.count, 1)
585 compare(spy.count, 1)
586+
587+ // test short swipe doesn't refresh on tall window
588+ mouseFlick(genericScopeView,
589+ genericScopeView.width/2, units.gu(10),
590+ genericScopeView.width/2, units.gu(20),
591+ true, false)
592+ mouseRelease(genericScopeView)
593+ compare(spy.count, 1)
594+
595+ // resize window, repeat the test
596+ var initialHeight = shell.height
597+ shell.height = units.gu(30)
598+ waitForRendering(shell)
599+ mouseFlick(genericScopeView,
600+ genericScopeView.width/2, units.gu(10),
601+ genericScopeView.width/2, units.gu(20),
602+ true, false)
603+
604+ tryCompare(pullToRefresh, "releaseToRefresh", true)
605+
606+ mouseRelease(genericScopeView)
607+ tryCompare(pullToRefresh, "releaseToRefresh", false)
608+
609+ spy.wait()
610+ compare(spy.count, 2)
611+
612+ shell.height = initialHeight
613+ waitForRendering(shell)
586 }
614 }
587
615
588 function test_item_noninteractive() {
616 function test_item_noninteractive() {