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
=== modified file 'launcher/LauncherIcon.cpp'
--- launcher/LauncherIcon.cpp 2013-10-04 00:19:56 +0000
+++ launcher/LauncherIcon.cpp 2013-10-07 23:30:49 +0000
@@ -450,9 +450,9 @@
450 return _shortcut;450 return _shortcut;
451}451}
452452
453nux::Point LauncherIcon::GetTipPosition() const453nux::Point LauncherIcon::GetTipPosition(int monitor) const
454{454{
455 return nux::Point(_center[_last_monitor].x + icon_size()/2 + 1, _center[_last_monitor].y);455 return nux::Point(_center[monitor].x + icon_size()/2 + 1, _center[monitor].y);
456}456}
457457
458void LauncherIcon::ShowTooltip()458void LauncherIcon::ShowTooltip()
@@ -463,7 +463,7 @@
463 if (!_tooltip)463 if (!_tooltip)
464 LoadTooltip();464 LoadTooltip();
465465
466 auto const& pos = GetTipPosition();466 auto const& pos = GetTipPosition(_last_monitor);
467 _tooltip->text = tooltip_text();467 _tooltip->text = tooltip_text();
468 _tooltip->ShowTooltipWithTipAt(pos.x, pos.y);468 _tooltip->ShowTooltipWithTipAt(pos.x, pos.y);
469 tooltip_visible.emit(_tooltip);469 tooltip_visible.emit(_tooltip);
@@ -546,7 +546,7 @@
546 if (win_manager.IsScaleActive())546 if (win_manager.IsScaleActive())
547 win_manager.TerminateScale();547 win_manager.TerminateScale();
548548
549 auto const& pos = GetTipPosition();549 auto const& pos = GetTipPosition(monitor);
550550
551 /* If the expo plugin is active, we need to wait it to be terminated, before551 /* If the expo plugin is active, we need to wait it to be terminated, before
552 * showing the icon quicklist. */552 * showing the icon quicklist. */
@@ -632,12 +632,12 @@
632 {632 {
633 if (_quicklist && _quicklist->IsVisible())633 if (_quicklist && _quicklist->IsVisible())
634 {634 {
635 auto const& pos = GetTipPosition();635 auto const& pos = GetTipPosition(monitor);
636 QuicklistManager::Default()->MoveQuicklist(_quicklist, pos.x, pos.y);636 QuicklistManager::Default()->MoveQuicklist(_quicklist, pos.x, pos.y);
637 }637 }
638 else if (_tooltip && _tooltip->IsVisible())638 else if (_tooltip && _tooltip->IsVisible())
639 {639 {
640 auto const& pos = GetTipPosition();640 auto const& pos = GetTipPosition(monitor);
641 _tooltip->SetTooltipPosition(pos.x, pos.y);641 _tooltip->SetTooltipPosition(pos.x, pos.y);
642 }642 }
643 }643 }
644644
=== modified file 'launcher/LauncherIcon.h'
--- launcher/LauncherIcon.h 2013-10-04 00:19:56 +0000
+++ launcher/LauncherIcon.h 2013-10-07 23:30:49 +0000
@@ -296,7 +296,7 @@
296 static void ChildRealized(DbusmenuMenuitem* newitem, QuicklistView* quicklist);296 static void ChildRealized(DbusmenuMenuitem* newitem, QuicklistView* quicklist);
297 static void RootChanged(DbusmenuClient* client, DbusmenuMenuitem* newroot, QuicklistView* quicklist);297 static void RootChanged(DbusmenuClient* client, DbusmenuMenuitem* newroot, QuicklistView* quicklist);
298 void ColorForIcon(GdkPixbuf* pixbuf, nux::Color& background, nux::Color& glow);298 void ColorForIcon(GdkPixbuf* pixbuf, nux::Color& background, nux::Color& glow);
299 nux::Point GetTipPosition() const;299 nux::Point GetTipPosition(int monitor) const;
300300
301 void LoadTooltip();301 void LoadTooltip();
302 void LoadQuicklist();302 void LoadQuicklist();
303303
=== modified file 'tests/autopilot/unity/tests/launcher/test_keynav.py'
--- tests/autopilot/unity/tests/launcher/test_keynav.py 2013-04-30 21:40:06 +0000
+++ tests/autopilot/unity/tests/launcher/test_keynav.py 2013-10-07 23:30:49 +0000
@@ -111,6 +111,7 @@
111 """Tests that we can open and close a quicklist from keynav mode."""111 """Tests that we can open and close a quicklist from keynav mode."""
112 self.start_keynav_with_cleanup_cancel()112 self.start_keynav_with_cleanup_cancel()
113 self.launcher_instance.key_nav_next()113 self.launcher_instance.key_nav_next()
114 self.addCleanup(self.keyboard.press_and_release, "Escape")
114 self.launcher_instance.key_nav_enter_quicklist()115 self.launcher_instance.key_nav_enter_quicklist()
115 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True)))116 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True)))
116 self.launcher_instance.key_nav_exit_quicklist()117 self.launcher_instance.key_nav_exit_quicklist()