on xenial help sign in
add a timer to pull to refresh to work on small windows (LP: #1589060)
commit86b4284aaf5fc62567d8bde3016a24f5cca1a184 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateFri 17 Jun 2016, 01:17 (10 years ago) parent9b01ee95dc14f3
2 files changed+29−1
qml/Dash/GenericScopeView.qml+1−1 tests/qmltests/Dash/tst_GenericScopeView.qml+28
qml/Dash/GenericScopeView.qml+1−1
@@ -733,7 +733,7 @@ FocusScope {
733733
734734 style: PullToRefreshScopeStyle {
735735 anchors.fill: parent
736− activationThreshold: units.gu(14)
736+ activationThreshold: Math.min(units.gu(14), scopeView.height / 5)
737737 }
738738 }
739739 }
tests/qmltests/Dash/tst_GenericScopeView.qml+28
@@ -583,6 +583,34 @@ Item {
583583
584584 spy.wait()
585585 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)
586614 }
587615
588616 function test_item_noninteractive() {