Merge lp:~aacid/unity8/departmentListHorizontalScroll into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 1526
Merged at revision: 1531
Proposed branch: lp:~aacid/unity8/departmentListHorizontalScroll
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/waitForRenderingNoCrash
Diff against target: 101 lines (+30/-3)
5 files modified
qml/Dash/DashContent.qml (+2/-2)
qml/Dash/DashNavigation.qml (+4/-0)
qml/Dash/DashNavigationButton.qml (+2/-0)
qml/Dash/GenericScopeView.qml (+1/-1)
tests/qmltests/Dash/tst_DashContent.qml (+21/-0)
To merge this branch: bzr merge lp:~aacid/unity8/departmentListHorizontalScroll
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+245748@code.launchpad.net

This proposal supersedes a proposal from 2015-01-05.

Commit message

Disable Dash horizontal scroll while Navigation InverseMouseArea is pressed

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
Prerequisite

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
y
 * Did CI run pass? If not, please explain why.
y
 * Did you make sure that the branch does not contain spurious tags?
y

review: Approve
1528. By Albert Astals Cid

Merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/DashContent.qml'
2--- qml/Dash/DashContent.qml 2014-12-15 22:42:44 +0000
3+++ qml/Dash/DashContent.qml 2015-01-08 08:14:20 +0000
4@@ -113,7 +113,7 @@
5 objectName: "dashContentList"
6
7 interactive: !dashContent.forceNonInteractive && dashContent.scopes.loaded && currentItem
8- && !currentItem.moving && !currentItem.navigationShown && !currentItem.subPageShown
9+ && !currentItem.moving && !currentItem.navigationDisableParentInteractive && !currentItem.subPageShown
10 anchors.fill: parent
11 orientation: ListView.Horizontal
12 boundsBehavior: Flickable.DragAndOvershootBounds
13@@ -175,7 +175,7 @@
14 objectName: "scopeLoader" + index
15
16 readonly property bool moving: item ? item.moving : false
17- readonly property bool navigationShown: item ? item.navigationShown : false
18+ readonly property bool navigationDisableParentInteractive: item ? item.navigationDisableParentInteractive : false
19 readonly property bool subPageShown: item ? item.subPageShown : false
20 readonly property var categoryView: item ? item.categoryView : null
21 readonly property var theScope: scope
22
23=== modified file 'qml/Dash/DashNavigation.qml'
24--- qml/Dash/DashNavigation.qml 2014-09-25 15:46:28 +0000
25+++ qml/Dash/DashNavigation.qml 2015-01-08 08:14:20 +0000
26@@ -33,6 +33,10 @@
27 if (altNavigationButton.showList) return altNavigationButton.listView;
28 return null;
29 }
30+ readonly property bool disableParentInteractive: {
31+ return navigationButton.showList || altNavigationButton.showList ||
32+ navigationButton.inverseMousePressed || altNavigationButton.inverseMousePressed;
33+ }
34
35 // FIXME this is only here for highlight purposes (see Background.qml, too)
36 readonly property var background: backgroundItem
37
38=== modified file 'qml/Dash/DashNavigationButton.qml'
39--- qml/Dash/DashNavigationButton.qml 2014-12-15 12:39:00 +0000
40+++ qml/Dash/DashNavigationButton.qml 2015-01-08 08:14:20 +0000
41@@ -31,6 +31,7 @@
42 // Used by parent
43 readonly property var currentNavigation: scope && scope[hasNavigation] ? getNavigation(scope[currentNavigationId]) : null
44 readonly property alias listView: navigationListView
45+ readonly property bool inverseMousePressed: inverseMouseArea.pressed
46 property bool showList: false
47
48 // Internal
49@@ -210,6 +211,7 @@
50 onCurrentNavigationChanged: setNewNavigation();
51
52 InverseMouseArea {
53+ id: inverseMouseArea
54 anchors.fill: navigationListView
55 enabled: root.showList
56 onPressed: root.showList = false
57
58=== modified file 'qml/Dash/GenericScopeView.qml'
59--- qml/Dash/GenericScopeView.qml 2014-12-15 22:42:11 +0000
60+++ qml/Dash/GenericScopeView.qml 2015-01-08 08:14:20 +0000
61@@ -25,7 +25,7 @@
62 FocusScope {
63 id: scopeView
64
65- readonly property bool navigationShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem[0].openList : false
66+ readonly property bool navigationDisableParentInteractive: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem[0].disableParentInteractive : false
67 property bool forceNonInteractive: false
68 property var scope: null
69 property SortFilterProxyModel categories: categoryFilter
70
71=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
72--- tests/qmltests/Dash/tst_DashContent.qml 2014-12-15 14:06:38 +0000
73+++ tests/qmltests/Dash/tst_DashContent.qml 2015-01-08 08:14:20 +0000
74@@ -505,6 +505,27 @@
75 compare(dashAltNavigationButton.showList, false);
76 }
77
78+ function test_navigationsSwipeToNextScope() {
79+ var dashContentList = findChild(dashContent, "dashContentList");
80+ tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
81+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
82+ tryCompare(dashNavigation, "visible", true);
83+ var dashNavigationButton = findChild(dashContentList.currentItem, "altNavigationButton");
84+ verify(dashNavigationButton, "Can't find navigation button");
85+
86+ compare(dashNavigationButton.showList, false);
87+ waitForRendering(dashNavigationButton);
88+ mouseClick(dashNavigationButton, 0, 0);
89+ compare(dashNavigationButton.showList, true);
90+
91+ mouseFlick(dashNavigationButton, dashNavigationButton.width - units.gu(1), units.gu(1), units.gu(1), units.gu(1));
92+ compare(dashNavigationButton.showList, false);
93+
94+ var dashContentList = findChild(dashContent, "dashContentList");
95+ expectFail("", "should not change the parent list.");
96+ tryCompare(dashContentList, "currentIndex", 1);
97+ }
98+
99 function test_searchHint() {
100 var dashContentList = findChild(dashContent, "dashContentList");
101 verify(dashContentList !== null);

Subscribers

People subscribed via source and target branches