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
1=== modified file 'launcher/LauncherIcon.cpp'
2--- launcher/LauncherIcon.cpp 2013-09-30 15:31:43 +0000
3+++ launcher/LauncherIcon.cpp 2013-10-04 00:32:31 +0000
4@@ -661,9 +661,9 @@
5 tip_y = new_center.y;
6
7 if (_quicklist && _quicklist->IsVisible())
8- QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
9+ QuicklistManager::Default()->MoveQuicklist(_quicklist, tip_x, tip_y);
10 else if (_tooltip && _tooltip->IsVisible())
11- _tooltip->ShowTooltipWithTipAt(tip_x, tip_y);
12+ _tooltip->SetTooltipPosition(tip_x, tip_y);
13 }
14
15 auto const& cb_func = sigc::mem_fun(this, &LauncherIcon::OnCenterStabilizeTimeout);
16
17=== modified file 'launcher/QuicklistManager.cpp'
18--- launcher/QuicklistManager.cpp 2013-09-24 02:03:12 +0000
19+++ launcher/QuicklistManager.cpp 2013-10-04 00:32:31 +0000
20@@ -78,11 +78,7 @@
21 int tip_y, bool hide_existing_if_open)
22 {
23 if (_current_quicklist == quicklist)
24- {
25- // this quicklist is already active
26- // do we want to still redraw in case the position has changed?
27 return;
28- }
29
30 if (hide_existing_if_open && _current_quicklist)
31 {
32@@ -93,6 +89,11 @@
33 nux::GetWindowCompositor().SetKeyFocusArea(quicklist.GetPointer());
34 }
35
36+void QuicklistManager::MoveQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist, int x, int y)
37+{
38+ quicklist->SetQuicklistPosition(x, y);
39+}
40+
41 void QuicklistManager::HideQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist)
42 {
43 quicklist->Hide();
44
45=== modified file 'launcher/QuicklistManager.h'
46--- launcher/QuicklistManager.h 2013-09-11 16:47:48 +0000
47+++ launcher/QuicklistManager.h 2013-10-04 00:32:31 +0000
48@@ -39,9 +39,10 @@
49
50 nux::ObjectPtr<QuicklistView> Current();
51
52- bool RegisterQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist);
53- void ShowQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist, int tip_x, int tip_y, bool hide_existing_if_open = true);
54- void HideQuicklist(nux::ObjectPtr<QuicklistView> const& quicklist);
55+ bool RegisterQuicklist(nux::ObjectPtr<QuicklistView> const&);
56+ void ShowQuicklist(nux::ObjectPtr<QuicklistView> const&, int x, int y, bool hide_existing_if_open = true);
57+ void HideQuicklist(nux::ObjectPtr<QuicklistView> const&);
58+ void MoveQuicklist(nux::ObjectPtr<QuicklistView> const&, int x, int y);
59
60 void RecvShowQuicklist(nux::BaseWindow* window);
61 void RecvHideQuicklist(nux::BaseWindow* window);
62
63=== modified file 'launcher/QuicklistView.cpp'
64--- launcher/QuicklistView.cpp 2013-09-30 15:08:09 +0000
65+++ launcher/QuicklistView.cpp 2013-10-04 00:32:31 +0000
66@@ -324,10 +324,10 @@
67 _enable_quicklist_for_testing = enable_testing;
68 }
69
70-void QuicklistView::ShowQuicklistWithTipAt(int anchor_tip_x, int anchor_tip_y)
71+void QuicklistView::SetQuicklistPosition(int tip_x, int tip_y)
72 {
73- _anchorX = anchor_tip_x;
74- _anchorY = anchor_tip_y;
75+ _anchorX = tip_x;
76+ _anchorY = tip_y;
77
78 if (!_enable_quicklist_for_testing)
79 {
80@@ -356,14 +356,14 @@
81 SetBaseXY(x, y);
82 }
83 }
84+}
85+
86+void QuicklistView::ShowQuicklistWithTipAt(int x, int y)
87+{
88+ SetQuicklistPosition(x, y);
89 Show();
90 }
91
92-void QuicklistView::ShowWindow(bool b, bool start_modal)
93-{
94- unity::CairoBaseWindow::ShowWindow(b, start_modal);
95-}
96-
97 void QuicklistView::Show()
98 {
99 if (!IsVisible())
100
101=== modified file 'launcher/QuicklistView.h'
102--- launcher/QuicklistView.h 2012-11-15 17:56:23 +0000
103+++ launcher/QuicklistView.h 2013-10-04 00:32:31 +0000
104@@ -55,8 +55,8 @@
105
106 void RenderQuicklistView();
107
108- void ShowQuicklistWithTipAt(int anchor_tip_x, int anchor_tip_y);
109- virtual void ShowWindow(bool b, bool StartModal = false);
110+ void SetQuicklistPosition(int x, int y);
111+ void ShowQuicklistWithTipAt(int x, int y);
112
113 void Show();
114 void Hide();
115
116=== modified file 'launcher/Tooltip.cpp'
117--- launcher/Tooltip.cpp 2013-09-30 15:08:09 +0000
118+++ launcher/Tooltip.cpp 2013-10-04 00:32:31 +0000
119@@ -100,15 +100,20 @@
120 return nullptr;
121 }
122
123-void Tooltip::ShowTooltipWithTipAt(int anchor_tip_x, int anchor_tip_y)
124+void Tooltip::SetTooltipPosition(int tip_x, int tip_y)
125 {
126- _anchorX = anchor_tip_x;
127- _anchorY = anchor_tip_y;
128+ _anchorX = tip_x;
129+ _anchorY = tip_y;
130
131 int x = _anchorX - PADDING;
132- int y = anchor_tip_y - ANCHOR_HEIGHT / 2 - TOP_SIZE - CORNER_RADIUS - PADDING;
133+ int y = _anchorY - ANCHOR_HEIGHT / 2 - TOP_SIZE - CORNER_RADIUS - PADDING;
134
135 SetBaseXY(x, y);
136+}
137+
138+void Tooltip::ShowTooltipWithTipAt(int x, int y)
139+{
140+ SetTooltipPosition(x, y);
141 Show();
142 }
143
144
145=== modified file 'launcher/Tooltip.h'
146--- launcher/Tooltip.h 2012-12-14 12:14:34 +0000
147+++ launcher/Tooltip.h 2013-10-04 00:32:31 +0000
148@@ -44,7 +44,8 @@
149 void Draw(nux::GraphicsEngine& gfxContext, bool forceDraw);
150 void DrawContent(nux::GraphicsEngine& gfxContext, bool forceDraw);
151
152- void ShowTooltipWithTipAt(int anchor_tip_x, int anchor_tip_y);
153+ void SetTooltipPosition(int x, int y);
154+ void ShowTooltipWithTipAt(int x, int y);
155
156 // Introspection
157 std::string GetName() const;