Merge lp:~3v1n0/unity/monitor-aware-ql into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3559
Proposed branch: lp:~3v1n0/unity/monitor-aware-ql
Merge into: lp:unity
Diff against target: 73 lines (+8/-7)
3 files modified
launcher/LauncherIcon.cpp (+6/-6)
launcher/LauncherIcon.h (+1/-1)
tests/autopilot/unity/tests/launcher/test_keynav.py (+1/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/monitor-aware-ql
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+189740@code.launchpad.net

Commit message

LauncherIcon: Add monitor parameter to GetTipPosition

Description of the change

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherIcon.cpp'
2--- launcher/LauncherIcon.cpp 2013-10-04 00:19:56 +0000
3+++ launcher/LauncherIcon.cpp 2013-10-07 23:30:49 +0000
4@@ -450,9 +450,9 @@
5 return _shortcut;
6 }
7
8-nux::Point LauncherIcon::GetTipPosition() const
9+nux::Point LauncherIcon::GetTipPosition(int monitor) const
10 {
11- return nux::Point(_center[_last_monitor].x + icon_size()/2 + 1, _center[_last_monitor].y);
12+ return nux::Point(_center[monitor].x + icon_size()/2 + 1, _center[monitor].y);
13 }
14
15 void LauncherIcon::ShowTooltip()
16@@ -463,7 +463,7 @@
17 if (!_tooltip)
18 LoadTooltip();
19
20- auto const& pos = GetTipPosition();
21+ auto const& pos = GetTipPosition(_last_monitor);
22 _tooltip->text = tooltip_text();
23 _tooltip->ShowTooltipWithTipAt(pos.x, pos.y);
24 tooltip_visible.emit(_tooltip);
25@@ -546,7 +546,7 @@
26 if (win_manager.IsScaleActive())
27 win_manager.TerminateScale();
28
29- auto const& pos = GetTipPosition();
30+ auto const& pos = GetTipPosition(monitor);
31
32 /* If the expo plugin is active, we need to wait it to be terminated, before
33 * showing the icon quicklist. */
34@@ -632,12 +632,12 @@
35 {
36 if (_quicklist && _quicklist->IsVisible())
37 {
38- auto const& pos = GetTipPosition();
39+ auto const& pos = GetTipPosition(monitor);
40 QuicklistManager::Default()->MoveQuicklist(_quicklist, pos.x, pos.y);
41 }
42 else if (_tooltip && _tooltip->IsVisible())
43 {
44- auto const& pos = GetTipPosition();
45+ auto const& pos = GetTipPosition(monitor);
46 _tooltip->SetTooltipPosition(pos.x, pos.y);
47 }
48 }
49
50=== modified file 'launcher/LauncherIcon.h'
51--- launcher/LauncherIcon.h 2013-10-04 00:19:56 +0000
52+++ launcher/LauncherIcon.h 2013-10-07 23:30:49 +0000
53@@ -296,7 +296,7 @@
54 static void ChildRealized(DbusmenuMenuitem* newitem, QuicklistView* quicklist);
55 static void RootChanged(DbusmenuClient* client, DbusmenuMenuitem* newroot, QuicklistView* quicklist);
56 void ColorForIcon(GdkPixbuf* pixbuf, nux::Color& background, nux::Color& glow);
57- nux::Point GetTipPosition() const;
58+ nux::Point GetTipPosition(int monitor) const;
59
60 void LoadTooltip();
61 void LoadQuicklist();
62
63=== modified file 'tests/autopilot/unity/tests/launcher/test_keynav.py'
64--- tests/autopilot/unity/tests/launcher/test_keynav.py 2013-04-30 21:40:06 +0000
65+++ tests/autopilot/unity/tests/launcher/test_keynav.py 2013-10-07 23:30:49 +0000
66@@ -111,6 +111,7 @@
67 """Tests that we can open and close a quicklist from keynav mode."""
68 self.start_keynav_with_cleanup_cancel()
69 self.launcher_instance.key_nav_next()
70+ self.addCleanup(self.keyboard.press_and_release, "Escape")
71 self.launcher_instance.key_nav_enter_quicklist()
72 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True)))
73 self.launcher_instance.key_nav_exit_quicklist()