Merge lp:~dandrader/unity8/dashBlackFlash-lp1417967 into lp:unity8

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1637
Merged at revision: 1676
Proposed branch: lp:~dandrader/unity8/dashBlackFlash-lp1417967
Merge into: lp:unity8
Diff against target: 96 lines (+54/-1)
3 files modified
qml/Panel/IndicatorsMenu.qml (+1/-0)
qml/Panel/Panel.qml (+1/-1)
tests/qmltests/Panel/tst_Panel.qml (+52/-0)
To merge this branch: bzr merge lp:~dandrader/unity8/dashBlackFlash-lp1417967
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+251484@code.launchpad.net

Commit message

Darkened area behind indicators menu should eat input until it fully disappears

Description of the change

* Are there any related MPs required for this MP to build/function as expected? Please list.
No.

* 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?
Not applicable.

* If you changed the UI, has there been a design review?
Not applicable.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

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

 * Did CI run pass? If not, please explain why.
Yes, minus sad autopilot

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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Panel/IndicatorsMenu.qml'
2--- qml/Panel/IndicatorsMenu.qml 2014-11-11 15:28:13 +0000
3+++ qml/Panel/IndicatorsMenu.qml 2015-03-02 17:25:31 +0000
4@@ -164,6 +164,7 @@
5
6 DragHandle {
7 id: __showDragHandle
8+ objectName: "showDragHandle"
9 anchors.bottom: parent.bottom
10 anchors.left: parent.left
11 anchors.right: parent.right
12
13=== modified file 'qml/Panel/Panel.qml'
14--- qml/Panel/Panel.qml 2015-01-26 13:48:08 +0000
15+++ qml/Panel/Panel.qml 2015-03-02 17:25:31 +0000
16@@ -40,10 +40,10 @@
17 }
18 color: "black"
19 opacity: indicators.unitProgress * darkenedOpacity
20+ visible: !indicators.fullyClosed
21
22 MouseArea {
23 anchors.fill: parent
24- enabled: indicators.shown
25 onClicked: if (indicators.fullyOpened) indicators.hide();
26 }
27 }
28
29=== modified file 'tests/qmltests/Panel/tst_Panel.qml'
30--- tests/qmltests/Panel/tst_Panel.qml 2015-01-26 13:48:08 +0000
31+++ tests/qmltests/Panel/tst_Panel.qml 2015-03-02 17:25:31 +0000
32@@ -163,6 +163,16 @@
33 return indicatorItem;
34 }
35
36+ function pullDownIndicatorsMenu() {
37+ var showDragHandle = findChild(panel, "showDragHandle");
38+ touchFlick(showDragHandle,
39+ showDragHandle.width / 2,
40+ showDragHandle.height / 2,
41+ showDragHandle.width / 2,
42+ showDragHandle.height / 2 + (showDragHandle.autoCompleteDragThreshold * 1.1));
43+ tryCompare(panel.indicators, "fullyOpened", true);
44+ }
45+
46 function test_drag_show_data() {
47 return [
48 { tag: "pinned", fullscreen: false, call: null,
49@@ -330,5 +340,47 @@
50
51 compare(backgroundPressedSpy.count, 0);
52 }
53+
54+ function test_darkenedAreaEatsAllEvents() {
55+
56+ // The center of the area not covered by the indicators menu
57+ // Ie, the visible darkened area behind the menu
58+ var touchPosX = (panel.width - panel.indicators.width) / 2
59+ var touchPosY = panel.indicators.minimizedPanelHeight +
60+ ((panel.height - panel.indicators.minimizedPanelHeight) / 2)
61+
62+ // input goes through while the indicators menu is closed
63+ tryCompare(panel.indicators, "fullyClosed", true);
64+ compare(backgroundPressedSpy.count, 0);
65+ tap(panel, touchPosX, touchPosY);
66+ compare(backgroundPressedSpy.count, 2);
67+
68+ pullDownIndicatorsMenu();
69+
70+ // Darkened area eats input when the indicators menu is fully opened
71+ tap(panel, touchPosX, touchPosY);
72+ compare(backgroundPressedSpy.count, 2);
73+ backgroundPressedSpy.clear();
74+
75+ // And should continue to eat inpunt until the indicators menu is fully closed
76+ wait(10);
77+ while (!panel.indicators.fullyClosed) {
78+ tap(panel, touchPosX, touchPosY);
79+
80+ // it could have got fully closed during the tap
81+ // so we have to double check here
82+ if (!panel.indicators.fullyClosed) {
83+ compare(backgroundPressedSpy.count, 0);
84+ }
85+
86+ // let the animation go a bit further
87+ wait(50);
88+ }
89+
90+ // Now that's fully closed, input should go through again
91+ backgroundPressedSpy.clear();
92+ tap(panel, touchPosX, touchPosY);
93+ compare(backgroundPressedSpy.count, 2);
94+ }
95 }
96 }

Subscribers

People subscribed via source and target branches