on xenial help sign in
shrink size of area for revealing the HUD button and make it disappear on release again.
85caf4cMichael Zanetti
Bottombar/Bottombar.qml+3−1
@@ -107,7 +107,7 @@ Item {
107 height: distanceThreshold
107 height: distanceThreshold
108 anchors.bottom: parent.bottom
108 anchors.bottom: parent.bottom
109
109
110− distanceThreshold: units.gu(8)
110+ distanceThreshold: units.gu(1)
111 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
111 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
112 direction: Direction.Upwards
112 direction: Direction.Upwards
113
113
@@ -119,6 +119,8 @@ Item {
119 if (previousStatus == DirectionalDragArea.Recognized) {
119 if (previousStatus == DirectionalDragArea.Recognized) {
120 if (hudButton.mouseOver) {
120 if (hudButton.mouseOver) {
121 hudButton.clicked()
121 hudButton.clicked()
122+ } else {
123+ bottombar.state = "hidden"
122 }
124 }
123 }
125 }
124 } else if (status === DirectionalDragArea.Undecided) {
126 } else if (status === DirectionalDragArea.Undecided) {
tests/autopilot/unity8/shell/tests/test_hud.py+7−2
@@ -34,6 +34,8 @@ class TestHud(UnityTestCase):
34
34
35 def test_show_hud_button_appears(self):
35 def test_show_hud_button_appears(self):
36 """Swiping up while an app is active must show the 'show hud' button.
36 """Swiping up while an app is active must show the 'show hud' button.
37+ The button must disappear not opening the HUD when releasing the
38+ mouse again somewhere on the screen except on the button itself.
37
39
38 """
40 """
39 self.launch_unity()
41 self.launch_unity()
@@ -49,9 +51,12 @@ class TestHud(UnityTestCase):
49 hud_show_button
51 hud_show_button
50 )
52 )
51 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
53 self.touch.press(swipe_coords.start_x, swipe_coords.start_y)
52− self.addCleanup(self.touch.release)
54+ self.addCleanup(self._maybe_release_finger)
53− self.touch._finger_move(swipe_coords.end_x, swipe_coords.end_y)
55+ self.touch._finger_move(swipe_coords.end_x, swipe_coords.end_y + hud_show_button.height);
54 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
56 self.assertThat(hud_show_button.opacity, Eventually(Equals(1.0)))
57+ self.touch.release();
58+ self.assertThat(hud_show_button.opacity, Eventually(Equals(0.0)))
59+ self.assertThat(hud.shown, Equals(False))
55
60
56 def test_show_hud_appears(self):
61 def test_show_hud_appears(self):
57 """Releasing the touch on the 'show hud' button must display the hud.
62 """Releasing the touch on the 'show hud' button must display the hud.