on xenial help sign in
Some changes to the interaction of the hud (approved by oren), plus work on autopilot
commit82166a471a61e96b75f0131ef54f33b914bca690 authorAndrea Cimitan <andrea.cimitan@canonical.com> dateTue 24 Sep 2013, 12:54 (13 years ago) parent1a274ae
3 files changed+25−1
Bottombar/Bottombar.qml+15 tests/autopilot/unity8/shell/emulators/main_window.py+3 tests/autopilot/unity8/shell/tests/test_hud.py+7−1
Bottombar/Bottombar.qml+15
@@ -120,6 +120,7 @@ Item {
120120
121121 EdgeDragArea {
122122 id: dragArea
123+ objectName: "hudDragArea"
123124 width: parent.width
124125 height: distanceThreshold
125126 anchors.bottom: parent.bottom
@@ -165,6 +166,7 @@ Item {
165166 }
166167
167168 Item {
169+ id: dismissArea
168170 anchors {
169171 top: parent.top
170172 left: parent.left
@@ -187,6 +189,19 @@ Item {
187189 }
188190 }
189191
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+
190205 states: [
191206 State {
192207 name: "hidden"
tests/autopilot/unity8/shell/emulators/main_window.py+3
@@ -58,6 +58,9 @@ class MainWindow(object):
5858 def get_hud_show_button(self):
5959 return self.app.select_single("HudButton")
6060
61+ def get_hud_edge_drag_area(self):
62+ return self.app.select_single(objectName="hudDragArea")
63+
6164 def get_dash(self):
6265 return self.app.select_single(Dash)
6366
tests/autopilot/unity8/shell/tests/test_hud.py+7−1
@@ -42,6 +42,7 @@ class TestHud(UnityTestCase):
4242 self.main_window.get_greeter().swipe()
4343 window = self.main_window.get_qml_view()
4444 hud_show_button = self.main_window.get_hud_show_button()
45+ edge_drag_area = self.main_window.get_hud_edge_drag_area()
4546 hud = self.main_window.get_hud()
4647
4748 self._launch_test_app_from_app_screen()
@@ -50,10 +51,15 @@ class TestHud(UnityTestCase):
5051 window,
5152 hud_show_button
5253 )
54+ initialBottomMargin = int(hud_show_button.bottomMargin)
5355 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
5456 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);
5661 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
62+# self.assertThat(hud_show_button.bottomMargin, Eventually(Equals(0.0)))
5763 self.touch.release();
5864 self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
5965 self.assertThat(hud.shown, Equals(False))