Merge lp:~mzanetti/unity8/launcher-initial-extensionSize into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 263
Merged at revision: 263
Proposed branch: lp:~mzanetti/unity8/launcher-initial-extensionSize
Merge into: lp:unity8
Diff against target: 53 lines (+18/-7)
2 files modified
Launcher/LauncherPanel.qml (+14/-1)
tests/qmltests/Launcher/tst_Launcher.qml (+4/-6)
To merge this branch: bzr merge lp:~mzanetti/unity8/launcher-initial-extensionSize
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+182504@code.launchpad.net

Commit message

setting the launcher's extensionSize delayed to position the view correctly at the beginning

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
263. By Michael Zanetti

enable test for this issue again and add a more detailed comment

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Launcher/LauncherPanel.qml'
2--- Launcher/LauncherPanel.qml 2013-08-27 06:59:04 +0000
3+++ Launcher/LauncherPanel.qml 2013-08-28 10:43:18 +0000
4@@ -110,7 +110,20 @@
5 // destroyed when dragging them outside the list. This needs to be at least
6 // itemHeight to prevent folded items from disappearing and DragArea limits
7 // need to be smaller than this size to avoid breakage.
8- property int extensionSize: itemHeight * 3
9+ property int extensionSize: 0
10+
11+ // Setting extensionSize after the list has been populated because it has
12+ // the potential to mess up with the intial positioning in combination
13+ // with snapping to the center of the list. This catches all the cases
14+ // where the item would be outside the list for more than itemHeight / 2.
15+ // For the rest, give it a flick to scroll to the beginning. Note that
16+ // the flicking alone isn't enough because in some cases it's not strong
17+ // enough to overcome the snapping.
18+ // https://bugreports.qt-project.org/browse/QTBUG-32251
19+ Component.onCompleted: {
20+ extensionSize = itemHeight * 3
21+ flick(0, clickFlickSpeed)
22+ }
23
24 // The height of the area where icons start getting folded
25 property int foldingStartHeight: units.gu(6.5)
26
27=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
28--- tests/qmltests/Launcher/tst_Launcher.qml 2013-08-23 16:19:10 +0000
29+++ tests/qmltests/Launcher/tst_Launcher.qml 2013-08-28 10:43:18 +0000
30@@ -249,11 +249,10 @@
31 name: "LauncherInit"
32 when: windowShown
33
34- /*
35- * FIXME: There is a bug in ListView which makes it snap to an item
36- * instead of the edge at startup. Enable this test once our patch for
37- * ListView has landed upstream.
38- * https://bugreports.qt-project.org/browse/QTBUG-32251
39+ function initTestCase() {
40+ var listView = findChild(launcher, "launcherListView");
41+ tryCompare(listView, "flicking", false)
42+ }
43
44 function test_initFirstUnfolded() {
45
46@@ -267,7 +266,6 @@
47 // Now do check that snapping is in fact enabled
48 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
49 }
50- */
51 }
52
53 UT.UnityTestCase {

Subscribers

People subscribed via source and target branches