Merge lp:~3v1n0/unity/ql-tooltip-fader 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: 3553
Proposed branch: lp:~3v1n0/unity/ql-tooltip-fader
Merge into: lp:unity
Diff against target: 157 lines (+32/-24)
7 files modified
launcher/LauncherIcon.cpp (+2/-2)
launcher/QuicklistManager.cpp (+5/-4)
launcher/QuicklistManager.h (+4/-3)
launcher/QuicklistView.cpp (+8/-8)
launcher/QuicklistView.h (+2/-2)
launcher/Tooltip.cpp (+9/-4)
launcher/Tooltip.h (+2/-1)
To merge this branch: bzr merge lp:~3v1n0/unity/ql-tooltip-fader
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+189196@code.launchpad.net

Commit message

LauncherIcon: don't try to show again quicklists or tooltip if center changed, just move them

Description of the change

Inside LauncherIcon we were trying to show again tooltips or quicklist when their center changed.
Now, we only move them to the new position.

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

Yay it works normally!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
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-09-30 15:31:43 +0000
+++ launcher/LauncherIcon.cpp 2013-10-04 00:32:31 +0000
@@ -661,9 +661,9 @@
661 tip_y = new_center.y;661 tip_y = new_center.y;
662662
663 if (_quicklist && _quicklist->IsVisible())663 if (_quicklist && _quicklist->IsVisible())
664 QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);664 QuicklistManager::Default()->MoveQuicklist(_quicklist, tip_x, tip_y);
665 else if (_tooltip && _tooltip->IsVisible())665 else if (_tooltip && _tooltip->IsVisible())
666 _tooltip->ShowTooltipWithTipAt(tip_x, tip_y);666 _tooltip->SetTooltipPosition(tip_x, tip_y);
667 }667 }
668668
669 auto const& cb_func = sigc::mem_fun(this, &LauncherIcon::OnCenterStabilizeTimeout);669 auto const& cb_func = sigc::mem_fun(this, &LauncherIcon::OnCenterStabilizeTimeout);
670670
=== modified file 'launcher/QuicklistManager.cpp'
--- launcher/QuicklistManager.cpp 2013-09-24 02:03:12 +0000
+++ launcher/QuicklistManager.cpp 2013-10-04 00:32:31 +0000
@@ -78,11 +78,7 @@
78 int tip_y, bool hide_existing_if_open)78 int tip_y, bool hide_existing_if_open)
79{79{
80 if (_current_quicklist == quicklist)80 if (_current_quicklist == quicklist)
81 {
82 // this quicklist is already active
83 // do we want to still redraw in case the position has changed?
84 return;81 return;
85 }
8682
87 if (hide_existing_if_open && _current_quicklist)83 if (hide_existing_if_open && _current_quicklist)
88 {84 {
@@ -93,6 +89,11 @@
93 nux::GetWindowCompositor().SetKeyFocusArea(quicklist.GetPointer());89 nux::GetWindowCompositor().SetKeyFocusArea(quicklist.GetPointer());
94}90}
9591
92void QuicklistManager::MoveQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist, int x, int y)
93{
94 quicklist->SetQuicklistPosition(x, y);
95}
96
96void QuicklistManager::HideQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist)97void QuicklistManager::HideQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist)
97{98{
98 quicklist->Hide();99 quicklist->Hide();
99100
=== modified file 'launcher/QuicklistManager.h'
--- launcher/QuicklistManager.h 2013-09-11 16:47:48 +0000
+++ launcher/QuicklistManager.h 2013-10-04 00:32:31 +0000
@@ -39,9 +39,10 @@
3939
40 nux::ObjectPtr<QuicklistView> Current();40 nux::ObjectPtr<QuicklistView> Current();
4141
42 bool RegisterQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist);42 bool RegisterQuicklist(nux::ObjectPtr<QuicklistView> const&);
43 void ShowQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist, int tip_x, int tip_y, bool hide_existing_if_open = true);43 void ShowQuicklist(nux::ObjectPtr<QuicklistView> const&, int x, int y, bool hide_existing_if_open = true);
44 void HideQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist);44 void HideQuicklist(nux::ObjectPtr<QuicklistView> const&);
45 void MoveQuicklist(nux::ObjectPtr<QuicklistView> const&, int x, int y);
4546
46 void RecvShowQuicklist(nux::BaseWindow* window);47 void RecvShowQuicklist(nux::BaseWindow* window);
47 void RecvHideQuicklist(nux::BaseWindow* window);48 void RecvHideQuicklist(nux::BaseWindow* window);
4849
=== modified file 'launcher/QuicklistView.cpp'
--- launcher/QuicklistView.cpp 2013-09-30 15:08:09 +0000
+++ launcher/QuicklistView.cpp 2013-10-04 00:32:31 +0000
@@ -324,10 +324,10 @@
324 _enable_quicklist_for_testing = enable_testing;324 _enable_quicklist_for_testing = enable_testing;
325}325}
326326
327void QuicklistView::ShowQuicklistWithTipAt(int anchor_tip_x, int anchor_tip_y)327void QuicklistView::SetQuicklistPosition(int tip_x, int tip_y)
328{328{
329 _anchorX = anchor_tip_x;329 _anchorX = tip_x;
330 _anchorY = anchor_tip_y;330 _anchorY = tip_y;
331331
332 if (!_enable_quicklist_for_testing)332 if (!_enable_quicklist_for_testing)
333 {333 {
@@ -356,14 +356,14 @@
356 SetBaseXY(x, y);356 SetBaseXY(x, y);
357 }357 }
358 }358 }
359}
360
361void QuicklistView::ShowQuicklistWithTipAt(int x, int y)
362{
363 SetQuicklistPosition(x, y);
359 Show();364 Show();
360}365}
361366
362void QuicklistView::ShowWindow(bool b, bool start_modal)
363{
364 unity::CairoBaseWindow::ShowWindow(b, start_modal);
365}
366
367void QuicklistView::Show()367void QuicklistView::Show()
368{368{
369 if (!IsVisible())369 if (!IsVisible())
370370
=== modified file 'launcher/QuicklistView.h'
--- launcher/QuicklistView.h 2012-11-15 17:56:23 +0000
+++ launcher/QuicklistView.h 2013-10-04 00:32:31 +0000
@@ -55,8 +55,8 @@
5555
56 void RenderQuicklistView();56 void RenderQuicklistView();
5757
58 void ShowQuicklistWithTipAt(int anchor_tip_x, int anchor_tip_y);58 void SetQuicklistPosition(int x, int y);
59 virtual void ShowWindow(bool b, bool StartModal = false);59 void ShowQuicklistWithTipAt(int x, int y);
6060
61 void Show();61 void Show();
62 void Hide();62 void Hide();
6363
=== modified file 'launcher/Tooltip.cpp'
--- launcher/Tooltip.cpp 2013-09-30 15:08:09 +0000
+++ launcher/Tooltip.cpp 2013-10-04 00:32:31 +0000
@@ -100,15 +100,20 @@
100 return nullptr;100 return nullptr;
101}101}
102102
103void Tooltip::ShowTooltipWithTipAt(int anchor_tip_x, int anchor_tip_y)103void Tooltip::SetTooltipPosition(int tip_x, int tip_y)
104{104{
105 _anchorX = anchor_tip_x;105 _anchorX = tip_x;
106 _anchorY = anchor_tip_y;106 _anchorY = tip_y;
107107
108 int x = _anchorX - PADDING;108 int x = _anchorX - PADDING;
109 int y = anchor_tip_y - ANCHOR_HEIGHT / 2 - TOP_SIZE - CORNER_RADIUS - PADDING;109 int y = _anchorY - ANCHOR_HEIGHT / 2 - TOP_SIZE - CORNER_RADIUS - PADDING;
110110
111 SetBaseXY(x, y);111 SetBaseXY(x, y);
112}
113
114void Tooltip::ShowTooltipWithTipAt(int x, int y)
115{
116 SetTooltipPosition(x, y);
112 Show();117 Show();
113}118}
114119
115120
=== modified file 'launcher/Tooltip.h'
--- launcher/Tooltip.h 2012-12-14 12:14:34 +0000
+++ launcher/Tooltip.h 2013-10-04 00:32:31 +0000
@@ -44,7 +44,8 @@
44 void Draw(nux::GraphicsEngine& gfxContext, bool forceDraw);44 void Draw(nux::GraphicsEngine& gfxContext, bool forceDraw);
45 void DrawContent(nux::GraphicsEngine& gfxContext, bool forceDraw);45 void DrawContent(nux::GraphicsEngine& gfxContext, bool forceDraw);
4646
47 void ShowTooltipWithTipAt(int anchor_tip_x, int anchor_tip_y);47 void SetTooltipPosition(int x, int y);
48 void ShowTooltipWithTipAt(int x, int y);
4849
49 // Introspection50 // Introspection
50 std::string GetName() const;51 std::string GetName() const;