Merge lp:~3v1n0/unity/hud-launcher-icon-closes-hud into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2330
Proposed branch: lp:~3v1n0/unity/hud-launcher-icon-closes-hud
Merge into: lp:unity
Diff against target: 59 lines (+18/-3)
3 files modified
plugins/unityshell/src/HudLauncherIcon.cpp (+5/-2)
tests/autopilot/autopilot/emulators/unity/icons.py (+1/-1)
tests/autopilot/autopilot/tests/test_hud.py (+12/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/hud-launcher-icon-closes-hud
Reviewer Review Type Date Requested Status
Gord Allott (community) Approve
Review via email: mp+103277@code.launchpad.net

Commit message

HudLauncherIcon: close the HUD when activating the icon

As design requested in bug #963918

Description of the change

Clicking the HUD icon should close it.

To fix it we only have to introduce an UBus call in the HudLauncherIcon's Activate method.

AP test included.

To post a comment you must log in.
Revision history for this message
Gord Allott (gordallott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/HudLauncherIcon.cpp'
2--- plugins/unityshell/src/HudLauncherIcon.cpp 2012-04-03 12:23:33 +0000
3+++ plugins/unityshell/src/HudLauncherIcon.cpp 2012-04-24 13:25:33 +0000
4@@ -72,7 +72,7 @@
5 ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), true));
6 ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), false));
7
8- mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); });
9+ mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW); });
10 }
11
12 void HudLauncherIcon::SetHideMode(LauncherHideMode hide_mode)
13@@ -117,7 +117,10 @@
14
15 void HudLauncherIcon::ActivateLauncherIcon(ActionArg arg)
16 {
17- // wut? activate? noo we don't do that.
18+ if (GetQuirk(QUIRK_VISIBLE))
19+ {
20+ ubus_manager_.SendMessage(UBUS_HUD_CLOSE_REQUEST);
21+ }
22 }
23
24 std::list<DbusmenuMenuitem*> HudLauncherIcon::GetMenus()
25
26=== modified file 'tests/autopilot/autopilot/emulators/unity/icons.py'
27--- tests/autopilot/autopilot/emulators/unity/icons.py 2012-04-17 02:46:26 +0000
28+++ tests/autopilot/autopilot/emulators/unity/icons.py 2012-04-24 13:25:33 +0000
29@@ -69,7 +69,7 @@
30 """Represents a launcher icon of a Software Center app."""
31
32
33-class HudEmbeddedIcon(SimpleLauncherIcon):
34+class HudEmbeddedIcon(UnityIntrospectionObject):
35 """Proxy object for the hud embedded icon child of the view."""
36
37 @property
38
39=== modified file 'tests/autopilot/autopilot/tests/test_hud.py'
40--- tests/autopilot/autopilot/tests/test_hud.py 2012-04-19 04:47:02 +0000
41+++ tests/autopilot/autopilot/tests/test_hud.py 2012-04-24 13:25:33 +0000
42@@ -332,6 +332,18 @@
43 else:
44 self.assertTrue(icon.desaturated)
45
46+ def test_hud_launcher_icon_click_hides_hud(self):
47+ """Clicking the Hud Icon should hide the HUD"""
48+
49+ hud_icon = self.hud.get_launcher_icon()
50+ self.hud.ensure_visible()
51+
52+ launcher = self.launcher.get_launcher_for_monitor(self.hud_monitor)
53+ launcher.click_launcher_icon(hud_icon)
54+
55+ self.assertThat(self.hud.visible, Eventually(Equals(False)))
56+ self.assertThat(hud_icon.visible, Eventually(Equals(False)))
57+
58
59 class HudVisualTests(HudTestsBase):
60