on xenial help sign in
Some changes to the interaction of the hud (approved by oren), plus work on autopilot
82166a4Andrea Cimitan
Bottombar/Bottombar.qml+15
@@ -120,6 +120,7 @@ Item {
120
120
121 EdgeDragArea {
121 EdgeDragArea {
122 id: dragArea
122 id: dragArea
123+ objectName: "hudDragArea"
123 width: parent.width
124 width: parent.width
124 height: distanceThreshold
125 height: distanceThreshold
125 anchors.bottom: parent.bottom
126 anchors.bottom: parent.bottom
@@ -165,6 +166,7 @@ Item {
165 }
166 }
166
167
167 Item {
168 Item {
169+ id: dismissArea
168 anchors {
170 anchors {
169 top: parent.top
171 top: parent.top
170 left: parent.left
172 left: parent.left
@@ -187,6 +189,19 @@ Item {
187 }
189 }
188 }
190 }
189
191
192+ MouseArea {
193+ anchors {
194+ top: dismissArea.bottom
195+ left: parent.left
196+ right: parent.right
197+ bottom: parent.bottom
198+ }
199+ enabled: bottombar.state == "shown" && bottomBarVisibilityCommunicatorShell.position > 0
200+ onPressed: {
201+ bottombar.state = "hidden"
202+ }
203+ }
204+
190 states: [
205 states: [
191 State {
206 State {
192 name: "hidden"
207 name: "hidden"
tests/autopilot/unity8/shell/emulators/main_window.py+3
@@ -58,6 +58,9 @@ class MainWindow(object):
58 def get_hud_show_button(self):
58 def get_hud_show_button(self):
59 return self.app.select_single("HudButton")
59 return self.app.select_single("HudButton")
60
60
61+ def get_hud_edge_drag_area(self):
62+ return self.app.select_single(objectName="hudDragArea")
63+
61 def get_dash(self):
64 def get_dash(self):
62 return self.app.select_single(Dash)
65 return self.app.select_single(Dash)
63
66
tests/autopilot/unity8/shell/tests/test_hud.py+7−1
@@ -42,6 +42,7 @@ class TestHud(UnityTestCase):
42 self.main_window.get_greeter().swipe()
42 self.main_window.get_greeter().swipe()
43 window = self.main_window.get_qml_view()
43 window = self.main_window.get_qml_view()
44 hud_show_button = self.main_window.get_hud_show_button()
44 hud_show_button = self.main_window.get_hud_show_button()
45+ edge_drag_area = self.main_window.get_hud_edge_drag_area()
45 hud = self.main_window.get_hud()
46 hud = self.main_window.get_hud()
46
47
47 self._launch_test_app_from_app_screen()
48 self._launch_test_app_from_app_screen()
@@ -50,10 +51,15 @@ class TestHud(UnityTestCase):
50 window,
51 window,
51 hud_show_button
52 hud_show_button
52 )
53 )
54+ initialBottomMargin = int(hud_show_button.bottomMargin)
53 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
55 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
54 self.addCleanup(self._maybe_release_finger)
56 self.addCleanup(self._maybe_release_finger)
55− self.touch._finger_move(swipe_coords.end_x, swipe_coords.end_y + hud_show_button.height);
57+ self.touch._finger_move(swipe_coords.end_x, swipe_coords.start_y - int(edge_drag_area.distanceThreshold) - 5);
58+ self.assertThat(hud_show_button.opacity, Eventually(Equals(0.5)))
59+ self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(initialBottomMargin)))
60+ self.touch._finger_move(swipe_coords.end_x, swipe_coords.end_y - hud_show_button.height);
56 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
61 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
62+# self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(0.0)))
57 self.touch.release();
63 self.touch.release();
58 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
64 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
59 self.assertThat(hud.shown, Equals(False))
65 self.assertThat(hud.shown, Equals(False))