Merge lp:~feng-kylin/unity/MoveDashToBottom into lp:unity
- MoveDashToBottom
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Marco Trevisan (Treviño) | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 4090 | ||||
Proposed branch: | lp:~feng-kylin/unity/MoveDashToBottom | ||||
Merge into: | lp:unity | ||||
Prerequisite: | lp:~feng-kylin/unity/unityshell-rotated-kylin | ||||
Diff against target: |
1051 lines (+369/-139) 21 files modified
dash/DashController.cpp (+22/-5) dash/DashView.cpp (+17/-1) hud/HudView.cpp (+1/-0) launcher/AbstractLauncherIcon.h (+1/-0) launcher/CairoBaseWindow.cpp (+6/-0) launcher/CairoBaseWindow.h (+1/-0) launcher/Launcher.h (+2/-1) launcher/LauncherController.cpp (+12/-0) launcher/LauncherIcon.cpp (+8/-0) launcher/LauncherIcon.h (+1/-0) launcher/MockLauncherIcon.h (+1/-0) launcher/QuicklistView.cpp (+26/-1) launcher/SoftwareCenterLauncherIcon.cpp (+0/-1) launcher/TooltipManager.cpp (+7/-1) tests/autopilot/unity/tests/launcher/test_keynav.py (+7/-4) tests/test_launcher.cpp (+1/-0) unity-shared/DashStyle.cpp (+82/-37) unity-shared/DashStyle.h (+13/-9) unity-shared/OverlayRenderer.cpp (+151/-79) unity-shared/OverlayRenderer.h (+7/-0) unity-shared/UBusMessages.h (+3/-0) |
||||
To merge this branch: | bzr merge lp:~feng-kylin/unity/MoveDashToBottom | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Review via email: mp+286016@code.launchpad.net |
Commit message
Dash: move it down when the launcher is positioned at the bottom.
Description of the change
Move the dash to the bottom.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Ah, also this black edge: http://
This can be fixed even later, but I guess it's just about to use the proper mask.
handsome_feng (feng-kylin) wrote : | # |
hi, Marco, I have update the code, and I know that time is running out.
But unfortunately, I found an AP test error in test_wm_
and test_left_maximize, the self.screen_
There is a 2 pixels difference... :/
and BTW, how about the bug of overlapped tooltip ?
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
> hi, Marco, I have update the code, and I know that time is running out.
> But unfortunately, I found an AP test error in test_wm_
> erKeybindingsFo
> and test_left_maximize, the self.screen_
> workarea_geo[3].
> There is a 2 pixels difference... :/
Ok, I can check that.
> and BTW, how about the bug of overlapped tooltip ?
I can't reproduce that, do you have a proper method?
However it seems something we can fix in a different branch.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
I can't reproduce that, do you have a proper method?
> However it seems something we can fix in a different branch.
Ok, I've noticed what you mean now... The thing is that the new tooltip is opened before the old one is closed, and thus, there's a double blurred background. Now, this doesn't happen in vertical mode because there's no overlapping area. Since the damage events arrives with some delay, there's glitch.
So, in order to get that working we need to quickly hide the tooltips when in horizontal mode.
This is one way: http://
So please apply that diff, although you need to fix tests for that to work (I've just built it for testing purposes).
Also instead of "virtual void HideTooltip(bool prompt = false) = 0" in AbstractLaunche
But this should give you an idea.
handsome_feng (feng-kylin) wrote : | # |
I apply the diff , but the unity will crash when call "animation:
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
I've noticed a tiny issue when using the keynav with quicklist...
By using left/right arrows the keynav should move selection to the next icon.
This should give you an idea of what I mean: http://
We've again a similar issue as we had for the tooltip in this case, but now you kno whow to fix it, so I guess you can finish it up quite easily :)
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Err fixed some white spacing: http://
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Again... Fixing the double-blur thing was just about calling PromptHide, so this is what you need: http://
Feel free to clean this up by adding methods, if you want.
handsome_feng (feng-kylin) wrote : | # |
About the Skip() method, I tried rebuilding the whole stuff,But the unity still crashed,
So I keep the Stop() method, and this works fine.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
> About the Skip() method, I tried rebuilding the whole stuff,But the unity
> still crashed,
> So I keep the Stop() method, and this works fine.
Ok, fair enough.
Once you've updated lp:~feng-kylin/unity/unityshell-rotated-kylin/+merge/281182, please merge this with that as well.
handsome_feng (feng-kylin) wrote : | # |
> > About the Skip() method, I tried rebuilding the whole stuff,But the unity
> > still crashed,
> > So I keep the Stop() method, and this works fine.
>
> Ok, fair enough.
>
> Once you've updated lp:~feng-kylin/unity/unityshell-rotated-
> kylin/+
Done.
Preview Diff
1 | === modified file 'dash/DashController.cpp' |
2 | --- dash/DashController.cpp 2016-03-18 07:01:34 +0000 |
3 | +++ dash/DashController.cpp 2016-03-18 07:01:34 +0000 |
4 | @@ -230,22 +230,22 @@ |
5 | nux::Geometry Controller::GetIdealWindowGeometry() |
6 | { |
7 | UScreen *uscreen = UScreen::GetDefault(); |
8 | - auto ideal_geo = uscreen->GetMonitorGeometry(GetIdealMonitor()); |
9 | + auto monitor_geo = uscreen->GetMonitorGeometry(GetIdealMonitor()); |
10 | int launcher_size = unity::Settings::Instance().LauncherSize(monitor_); |
11 | |
12 | // We want to cover as much of the screen as possible to grab any mouse events outside |
13 | // of our window |
14 | if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) |
15 | { |
16 | - ideal_geo.x += launcher_size; |
17 | - ideal_geo.width -= launcher_size; |
18 | + monitor_geo.x += launcher_size; |
19 | + monitor_geo.width -= launcher_size; |
20 | } |
21 | else |
22 | { |
23 | - ideal_geo.height -= launcher_size; |
24 | + monitor_geo.height -= launcher_size; |
25 | } |
26 | |
27 | - return ideal_geo; |
28 | + return monitor_geo; |
29 | } |
30 | |
31 | void Controller::OnMonitorChanged(int primary, std::vector<nux::Geometry> const& monitors) |
32 | @@ -278,6 +278,12 @@ |
33 | { |
34 | left_offset = launcher_size; |
35 | } |
36 | + else if (launcher_position == LauncherPosition::BOTTOM && |
37 | + Settings::Instance().form_factor() == FormFactor::DESKTOP) |
38 | + { |
39 | + auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor_); |
40 | + top_offset = monitor_geo.height - view_->GetContentGeometry().height - launcher_size; |
41 | + } |
42 | |
43 | view_->SetMonitorOffset(left_offset, top_offset); |
44 | } |
45 | @@ -489,6 +495,8 @@ |
46 | nux::Geometry Controller::GetInputWindowGeometry() |
47 | { |
48 | EnsureDash(); |
49 | + int launcher_size = Settings::Instance().LauncherSize(monitor_); |
50 | + auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor_); |
51 | dash::Style& style = dash::Style::Instance(); |
52 | nux::Geometry const& window_geo(window_->GetGeometry()); |
53 | nux::Geometry const& view_content_geo(view_->GetContentGeometry()); |
54 | @@ -499,6 +507,15 @@ |
55 | { |
56 | geo.width += style.GetDashVerticalBorderWidth().CP(view_->scale()); |
57 | geo.height += style.GetDashHorizontalBorderHeight().CP(view_->scale()); |
58 | + |
59 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) |
60 | + geo.y = monitor_geo.height - view_content_geo.height - launcher_size - style.GetDashHorizontalBorderHeight().CP(view_->scale()); |
61 | + } |
62 | + else if (Settings::Instance().form_factor() == FormFactor::NETBOOK) |
63 | + { |
64 | + geo.height = monitor_geo.height; |
65 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) |
66 | + geo.height -= launcher_size; |
67 | } |
68 | |
69 | return geo; |
70 | |
71 | === modified file 'dash/DashView.cpp' |
72 | --- dash/DashView.cpp 2016-02-17 18:40:53 +0000 |
73 | +++ dash/DashView.cpp 2016-03-18 07:01:34 +0000 |
74 | @@ -133,6 +133,7 @@ |
75 | , monitor_(0) |
76 | { |
77 | renderer_.SetOwner(this); |
78 | + renderer_.owner_type = OverlayOwner::Dash; |
79 | renderer_.need_redraw.connect([this] () { |
80 | QueueDraw(); |
81 | }); |
82 | @@ -650,7 +651,20 @@ |
83 | ubus_manager_.SendMessage(UBUS_DASH_SIZE_CHANGED, g_variant_new("(ii)", content_geo_.width, content_geo_.height)); |
84 | |
85 | if (preview_displaying_) |
86 | - preview_container_->SetGeometry(layout_->GetGeometry()); |
87 | + { |
88 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) |
89 | + { |
90 | + auto preview_geo = content_geo_; |
91 | + int padding = style.GetDashHorizontalBorderHeight().CP(scale()); |
92 | + preview_geo.y += padding; |
93 | + preview_geo.height -= padding; |
94 | + preview_container_->SetGeometry(preview_geo); |
95 | + } |
96 | + else |
97 | + { |
98 | + preview_container_->SetGeometry(layout_->GetGeometry()); |
99 | + } |
100 | + } |
101 | |
102 | renderer_.UpdateBlurBackgroundSize(content_geo_, GetRenderAbsoluteGeometry(), false); |
103 | |
104 | @@ -729,6 +743,8 @@ |
105 | // See lp bug: 1125346 (The sharp white line between dash and launcher is missing) |
106 | nux::Geometry clip_geo = geo_layout; |
107 | clip_geo.x += 1; |
108 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) |
109 | + clip_geo.y += renderer_y_offset; |
110 | graphics_engine.PushClippingRectangle(clip_geo); |
111 | |
112 | if (IsFullRedraw()) |
113 | |
114 | === modified file 'hud/HudView.cpp' |
115 | --- hud/HudView.cpp 2014-07-11 01:45:24 +0000 |
116 | +++ hud/HudView.cpp 2016-03-18 07:01:34 +0000 |
117 | @@ -73,6 +73,7 @@ |
118 | scale = Settings::Instance().em()->DPIScale(); |
119 | renderer_.scale = scale(); |
120 | renderer_.SetOwner(this); |
121 | + renderer_.owner_type = OverlayOwner::Hud; |
122 | renderer_.need_redraw.connect([this] () { |
123 | QueueDraw(); |
124 | }); |
125 | |
126 | === modified file 'launcher/AbstractLauncherIcon.h' |
127 | --- launcher/AbstractLauncherIcon.h 2015-11-25 23:16:11 +0000 |
128 | +++ launcher/AbstractLauncherIcon.h 2016-03-18 07:01:34 +0000 |
129 | @@ -144,6 +144,7 @@ |
130 | |
131 | virtual void ShowTooltip() = 0; |
132 | virtual void HideTooltip() = 0; |
133 | + virtual void PromptHideTooltip() = 0; |
134 | |
135 | virtual void SetShortcut(guint64 shortcut) = 0; |
136 | |
137 | |
138 | === modified file 'launcher/CairoBaseWindow.cpp' |
139 | --- launcher/CairoBaseWindow.cpp 2014-02-25 18:41:37 +0000 |
140 | +++ launcher/CairoBaseWindow.cpp 2016-03-18 07:01:34 +0000 |
141 | @@ -73,6 +73,12 @@ |
142 | animation::StartOrReverse(fade_animator_, animation::Direction::BACKWARD); |
143 | } |
144 | |
145 | +void CairoBaseWindow::PromptHide() |
146 | +{ |
147 | + Hide(); |
148 | + fade_animator_.Stop(); |
149 | +} |
150 | + |
151 | void CairoBaseWindow::RedrawBlur() |
152 | { |
153 | compute_blur_bkg_ = true; |
154 | |
155 | === modified file 'launcher/CairoBaseWindow.h' |
156 | --- launcher/CairoBaseWindow.h 2014-02-25 18:41:37 +0000 |
157 | +++ launcher/CairoBaseWindow.h 2016-03-18 07:01:34 +0000 |
158 | @@ -35,6 +35,7 @@ |
159 | |
160 | virtual void Show(); |
161 | virtual void Hide(); |
162 | + void PromptHide(); |
163 | |
164 | void RedrawBlur(); |
165 | bool HasBlurredBackground() const; |
166 | |
167 | === modified file 'launcher/Launcher.h' |
168 | --- launcher/Launcher.h 2016-03-18 07:01:34 +0000 |
169 | +++ launcher/Launcher.h 2016-03-18 07:01:34 +0000 |
170 | @@ -43,7 +43,6 @@ |
171 | #include "LauncherHoverMachine.h" |
172 | #include "unity-shared/MockableBaseWindow.h" |
173 | #include "unity-shared/UBusWrapper.h" |
174 | -#include "unity-shared/UnitySettings.h" |
175 | #include "SoftwareCenterLauncherIcon.h" |
176 | #include "TooltipManager.h" |
177 | |
178 | @@ -54,6 +53,8 @@ |
179 | |
180 | namespace unity |
181 | { |
182 | +enum class LauncherPosition; |
183 | + |
184 | namespace launcher |
185 | { |
186 | extern const char* window_title; |
187 | |
188 | === modified file 'launcher/LauncherController.cpp' |
189 | --- launcher/LauncherController.cpp 2016-03-18 07:01:34 +0000 |
190 | +++ launcher/LauncherController.cpp 2016-03-18 07:01:34 +0000 |
191 | @@ -180,6 +180,18 @@ |
192 | } |
193 | }); |
194 | |
195 | + ubus.RegisterInterest(UBUS_LAUNCHER_NEXT_KEY_NAV, [this] (GVariant*) { |
196 | + parent_->KeyNavNext(); |
197 | + }); |
198 | + |
199 | + ubus.RegisterInterest(UBUS_LAUNCHER_PREV_KEY_NAV, [this] (GVariant*) { |
200 | + parent_->KeyNavPrevious(); |
201 | + }); |
202 | + |
203 | + ubus.RegisterInterest(UBUS_LAUNCHER_OPEN_QUICKLIST, [this] (GVariant*) { |
204 | + OpenQuicklist(); |
205 | + }); |
206 | + |
207 | parent_->AddChild(model_.get()); |
208 | |
209 | xdnd_manager_->dnd_started.connect(sigc::mem_fun(this, &Impl::OnDndStarted)); |
210 | |
211 | === modified file 'launcher/LauncherIcon.cpp' |
212 | --- launcher/LauncherIcon.cpp 2016-03-18 07:01:34 +0000 |
213 | +++ launcher/LauncherIcon.cpp 2016-03-18 07:01:34 +0000 |
214 | @@ -645,6 +645,14 @@ |
215 | tooltip_visible.emit(nux::ObjectPtr<nux::View>()); |
216 | } |
217 | |
218 | +void LauncherIcon::PromptHideTooltip() |
219 | +{ |
220 | + if (_tooltip) |
221 | + _tooltip->PromptHide(); |
222 | + |
223 | + tooltip_visible.emit(nux::ObjectPtr<nux::View>()); |
224 | +} |
225 | + |
226 | void LauncherIcon::SetCenter(nux::Point3 const& new_center, int monitor) |
227 | { |
228 | nux::Point3& center = _center[monitor]; |
229 | |
230 | === modified file 'launcher/LauncherIcon.h' |
231 | --- launcher/LauncherIcon.h 2016-02-25 15:59:41 +0000 |
232 | +++ launcher/LauncherIcon.h 2016-03-18 07:01:34 +0000 |
233 | @@ -70,6 +70,7 @@ |
234 | void RecvMouseClick(int button, int monitor, unsigned long key_flags = 0); |
235 | |
236 | void HideTooltip(); |
237 | + void PromptHideTooltip(); |
238 | |
239 | void ShowTooltip(); |
240 | |
241 | |
242 | === modified file 'launcher/MockLauncherIcon.h' |
243 | --- launcher/MockLauncherIcon.h 2015-11-25 23:16:11 +0000 |
244 | +++ launcher/MockLauncherIcon.h 2016-03-18 07:01:34 +0000 |
245 | @@ -87,6 +87,7 @@ |
246 | |
247 | void ShowTooltip() { is_tooltip_visible_ = true; } |
248 | void HideTooltip() { is_tooltip_visible_ = false; } |
249 | + void PromptHideTooltip() { is_tooltip_visible_ = false; } |
250 | bool IsTooltipVisible() { return is_tooltip_visible_; } |
251 | |
252 | void SetShortcut(guint64 shortcut) {} |
253 | |
254 | === modified file 'launcher/QuicklistView.cpp' |
255 | --- launcher/QuicklistView.cpp 2016-03-18 07:01:34 +0000 |
256 | +++ launcher/QuicklistView.cpp 2016-03-18 07:01:34 +0000 |
257 | @@ -325,7 +325,32 @@ |
258 | // left (close quicklist, go back to laucher key-nav) |
259 | case NUX_VK_LEFT: |
260 | case NUX_KP_LEFT: |
261 | - HideAndEndQuicklistNav(); |
262 | + |
263 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) |
264 | + { |
265 | + PromptHide(); |
266 | + UBusManager::SendMessage(UBUS_QUICKLIST_END_KEY_NAV); |
267 | + UBusManager::SendMessage(UBUS_LAUNCHER_PREV_KEY_NAV); |
268 | + UBusManager::SendMessage(UBUS_LAUNCHER_OPEN_QUICKLIST); |
269 | + } |
270 | + else |
271 | + { |
272 | + HideAndEndQuicklistNav(); |
273 | + } |
274 | + |
275 | + break; |
276 | + |
277 | + // right (close quicklist, go back to launcher key-nav) |
278 | + case NUX_VK_RIGHT: |
279 | + case NUX_KP_RIGHT: |
280 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) |
281 | + { |
282 | + PromptHide(); |
283 | + UBusManager::SendMessage(UBUS_QUICKLIST_END_KEY_NAV); |
284 | + UBusManager::SendMessage(UBUS_LAUNCHER_NEXT_KEY_NAV); |
285 | + UBusManager::SendMessage(UBUS_LAUNCHER_OPEN_QUICKLIST); |
286 | + } |
287 | + |
288 | break; |
289 | |
290 | // esc (close quicklist, exit key-nav) |
291 | |
292 | === modified file 'launcher/SoftwareCenterLauncherIcon.cpp' |
293 | --- launcher/SoftwareCenterLauncherIcon.cpp 2016-03-18 07:01:34 +0000 |
294 | +++ launcher/SoftwareCenterLauncherIcon.cpp 2016-02-23 15:39:49 +0000 |
295 | @@ -31,7 +31,6 @@ |
296 | #include "LauncherDragWindow.h" |
297 | #include "LauncherModel.h" |
298 | #include "DesktopUtilities.h" |
299 | -#include "unity-shared/UnitySettings.h" |
300 | |
301 | namespace unity |
302 | { |
303 | |
304 | === modified file 'launcher/TooltipManager.cpp' |
305 | --- launcher/TooltipManager.cpp 2013-11-14 03:00:29 +0000 |
306 | +++ launcher/TooltipManager.cpp 2016-03-18 07:01:34 +0000 |
307 | @@ -19,6 +19,7 @@ |
308 | */ |
309 | |
310 | #include "TooltipManager.h" |
311 | +#include "unity-shared/UnitySettings.h" |
312 | |
313 | namespace unity |
314 | { |
315 | @@ -40,7 +41,12 @@ |
316 | |
317 | StopTimer(); |
318 | if (icon_) |
319 | - icon_->HideTooltip(); |
320 | + { |
321 | + if (Settings::Instance().launcher_position() == LauncherPosition::LEFT) |
322 | + icon_->HideTooltip(); |
323 | + else |
324 | + icon_->PromptHideTooltip(); |
325 | + } |
326 | |
327 | icon_ = icon_under_mouse; |
328 | |
329 | |
330 | === added file 'resources/dash_bottom_right_corner_rotated.png' |
331 | Binary files resources/dash_bottom_right_corner_rotated.png 1970-01-01 00:00:00 +0000 and resources/dash_bottom_right_corner_rotated.png 2016-03-18 07:01:34 +0000 differ |
332 | === added file 'resources/dash_bottom_right_corner_rotated_mask.png' |
333 | Binary files resources/dash_bottom_right_corner_rotated_mask.png 1970-01-01 00:00:00 +0000 and resources/dash_bottom_right_corner_rotated_mask.png 2016-03-18 07:01:34 +0000 differ |
334 | === added file 'resources/dash_bottom_tile.png' |
335 | Binary files resources/dash_bottom_tile.png 1970-01-01 00:00:00 +0000 and resources/dash_bottom_tile.png 2016-03-18 07:01:34 +0000 differ |
336 | === added file 'resources/dash_top_border_tile.png' |
337 | Binary files resources/dash_top_border_tile.png 1970-01-01 00:00:00 +0000 and resources/dash_top_border_tile.png 2016-03-18 07:01:34 +0000 differ |
338 | === added file 'resources/dash_top_border_tile_mask.png' |
339 | Binary files resources/dash_top_border_tile_mask.png 1970-01-01 00:00:00 +0000 and resources/dash_top_border_tile_mask.png 2016-03-18 07:01:34 +0000 differ |
340 | === added file 'resources/dash_top_left_corner.png' |
341 | Binary files resources/dash_top_left_corner.png 1970-01-01 00:00:00 +0000 and resources/dash_top_left_corner.png 2016-03-18 07:01:34 +0000 differ |
342 | === added file 'resources/dash_top_left_corner_mask.png' |
343 | Binary files resources/dash_top_left_corner_mask.png 1970-01-01 00:00:00 +0000 and resources/dash_top_left_corner_mask.png 2016-03-18 07:01:34 +0000 differ |
344 | === added file 'resources/dash_top_right_corner_rotated.png' |
345 | Binary files resources/dash_top_right_corner_rotated.png 1970-01-01 00:00:00 +0000 and resources/dash_top_right_corner_rotated.png 2016-03-18 07:01:34 +0000 differ |
346 | === added file 'resources/dash_top_right_corner_rotated_mask.png' |
347 | Binary files resources/dash_top_right_corner_rotated_mask.png 1970-01-01 00:00:00 +0000 and resources/dash_top_right_corner_rotated_mask.png 2016-03-18 07:01:34 +0000 differ |
348 | === modified file 'tests/autopilot/unity/tests/launcher/test_keynav.py' |
349 | --- tests/autopilot/unity/tests/launcher/test_keynav.py 2016-03-18 07:01:34 +0000 |
350 | +++ tests/autopilot/unity/tests/launcher/test_keynav.py 2016-03-18 07:01:34 +0000 |
351 | @@ -13,6 +13,7 @@ |
352 | import logging |
353 | from testtools.matchers import Equals, GreaterThan |
354 | |
355 | +from unity.emulators.launcher import LauncherPosition |
356 | from unity.tests.launcher import LauncherTestCase |
357 | |
358 | logger = logging.getLogger(__name__) |
359 | @@ -114,10 +115,12 @@ |
360 | self.addCleanup(self.keyboard.press_and_release, "Escape") |
361 | self.launcher_instance.key_nav_enter_quicklist(self.launcher_position) |
362 | self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True))) |
363 | - self.launcher_instance.key_nav_exit_quicklist() |
364 | - self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(False))) |
365 | - self.assertThat(self.unity.launcher.key_nav_is_active, Eventually(Equals(True))) |
366 | - self.assertThat(self.unity.launcher.key_nav_is_grabbed, Eventually(Equals(True))) |
367 | + # We can't close a quicklist from keynav mode when launcher at bottom. |
368 | + if self.launcher_position == LauncherPosition.LEFT: |
369 | + self.launcher_instance.key_nav_exit_quicklist() |
370 | + self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(False))) |
371 | + self.assertThat(self.unity.launcher.key_nav_is_active, Eventually(Equals(True))) |
372 | + self.assertThat(self.unity.launcher.key_nav_is_grabbed, Eventually(Equals(True))) |
373 | |
374 | def test_launcher_keynav_mode_toggles(self): |
375 | """Tests that keynav mode toggles with Alt+F1.""" |
376 | |
377 | === modified file 'tests/test_launcher.cpp' |
378 | --- tests/test_launcher.cpp 2016-03-18 07:01:34 +0000 |
379 | +++ tests/test_launcher.cpp 2016-03-18 07:01:34 +0000 |
380 | @@ -62,6 +62,7 @@ |
381 | MOCK_METHOD1(Stick, void(bool)); |
382 | MOCK_METHOD2(PerformScroll, void(ScrollDirection, Time)); |
383 | MOCK_METHOD0(HideTooltip, void()); |
384 | + MOCK_METHOD0(PromptHideTooltip, void()); |
385 | MOCK_METHOD3(SetQuirk, void(ApplicationLauncherIcon::Quirk, bool, int)); |
386 | MOCK_METHOD2(SetQuirk, void(ApplicationLauncherIcon::Quirk, bool)); |
387 | MOCK_METHOD2(SkipQuirkAnimation, void(ApplicationLauncherIcon::Quirk, int)); |
388 | |
389 | === modified file 'unity-shared/DashStyle.cpp' |
390 | --- unity-shared/DashStyle.cpp 2016-03-10 10:09:12 +0000 |
391 | +++ unity-shared/DashStyle.cpp 2016-03-18 07:01:34 +0000 |
392 | @@ -2082,14 +2082,24 @@ |
393 | return true; |
394 | } |
395 | |
396 | -BaseTexturePtr Style::GetDashBottomTile(double scale) const |
397 | +BaseTexturePtr Style::GetDashHorizontalTile(double scale, DashPosition dash_position) const |
398 | { |
399 | - return pimpl->LoadScaledTexture("dash_bottom_border_tile.png", scale); |
400 | + std::string horizontal_tile; |
401 | + if (dash_position == DashPosition::BOTTOM) |
402 | + horizontal_tile = "dash_top_border_tile.png"; |
403 | + else |
404 | + horizontal_tile = "dash_bottom_border_tile.png"; |
405 | + return pimpl->LoadScaledTexture(horizontal_tile, scale); |
406 | } |
407 | |
408 | -BaseTexturePtr Style::GetDashBottomTileMask(double scale) const |
409 | +BaseTexturePtr Style::GetDashHorizontalTileMask(double scale, DashPosition dash_position) const |
410 | { |
411 | - return pimpl->LoadScaledTexture("dash_bottom_border_tile_mask.png", scale); |
412 | + std::string horizontal_tile_mask; |
413 | + if (dash_position == DashPosition::BOTTOM) |
414 | + horizontal_tile_mask = "dash_top_border_tile_mask.png"; |
415 | + else |
416 | + horizontal_tile_mask = "dash_bottom_border_tile_mask.png"; |
417 | + return pimpl->LoadScaledTexture(horizontal_tile_mask, scale); |
418 | } |
419 | |
420 | BaseTexturePtr Style::GetDashRightTile(double scale) const |
421 | @@ -2107,39 +2117,74 @@ |
422 | return pimpl->LoadScaledTexture("dash_left_tile.png", scale); |
423 | } |
424 | |
425 | -BaseTexturePtr Style::GetDashTopTile(double scale) const |
426 | -{ |
427 | - return pimpl->LoadScaledTexture("dash_top_tile.png", scale); |
428 | -} |
429 | - |
430 | -BaseTexturePtr Style::GetDashCorner(double scale) const |
431 | -{ |
432 | - return pimpl->LoadScaledTexture("dash_bottom_right_corner.png", scale); |
433 | -} |
434 | - |
435 | -BaseTexturePtr Style::GetDashCornerMask(double scale) const |
436 | -{ |
437 | - return pimpl->LoadScaledTexture("dash_bottom_right_corner_mask.png", scale); |
438 | -} |
439 | - |
440 | -BaseTexturePtr Style::GetDashLeftCorner(double scale) const |
441 | -{ |
442 | - return pimpl->LoadScaledTexture("dash_bottom_left_corner.png", scale); |
443 | -} |
444 | - |
445 | -BaseTexturePtr Style::GetDashLeftCornerMask(double scale) const |
446 | -{ |
447 | - return pimpl->LoadScaledTexture("dash_bottom_left_corner_mask.png", scale); |
448 | -} |
449 | - |
450 | -BaseTexturePtr Style::GetDashTopCorner(double scale) const |
451 | -{ |
452 | - return pimpl->LoadScaledTexture("dash_top_right_corner.png", scale); |
453 | -} |
454 | - |
455 | -BaseTexturePtr Style::GetDashTopCornerMask(double scale) const |
456 | -{ |
457 | - return pimpl->LoadScaledTexture("dash_top_right_corner_mask.png", scale); |
458 | +BaseTexturePtr Style::GetDashTopOrBottomTile(double scale, DashPosition dash_position) const |
459 | +{ |
460 | + std::string top_bottom_tile; |
461 | + if (dash_position == DashPosition::BOTTOM) |
462 | + top_bottom_tile = "dash_bottom_tile.png"; |
463 | + else |
464 | + top_bottom_tile = "dash_top_tile.png"; |
465 | + return pimpl->LoadScaledTexture(top_bottom_tile, scale); |
466 | +} |
467 | + |
468 | +BaseTexturePtr Style::GetDashCorner(double scale, DashPosition dash_position) const |
469 | +{ |
470 | + std::string corner; |
471 | + if (dash_position == DashPosition::BOTTOM) |
472 | + corner = "dash_top_right_corner_rotated.png"; |
473 | + else |
474 | + corner = "dash_bottom_right_corner.png"; |
475 | + return pimpl->LoadScaledTexture(corner, scale); |
476 | +} |
477 | + |
478 | +BaseTexturePtr Style::GetDashCornerMask(double scale, DashPosition dash_position) const |
479 | +{ |
480 | + std::string corner_mask; |
481 | + if (dash_position == DashPosition::BOTTOM) |
482 | + corner_mask = "dash_top_right_corner_rotated_mask.png"; |
483 | + else |
484 | + corner_mask = "dash_bottom_right_corner_mask.png"; |
485 | + return pimpl->LoadScaledTexture(corner_mask, scale); |
486 | +} |
487 | + |
488 | +BaseTexturePtr Style::GetDashLeftCorner(double scale, DashPosition dash_position) const |
489 | +{ |
490 | + std::string left_corner; |
491 | + if (dash_position == DashPosition::BOTTOM) |
492 | + left_corner = "dash_top_left_corner.png"; |
493 | + else |
494 | + left_corner = "dash_bottom_left_corner.png"; |
495 | + return pimpl->LoadScaledTexture(left_corner, scale); |
496 | +} |
497 | + |
498 | +BaseTexturePtr Style::GetDashLeftCornerMask(double scale, DashPosition dash_position) const |
499 | +{ |
500 | + std::string left_corner_mask; |
501 | + if (dash_position == DashPosition::BOTTOM) |
502 | + left_corner_mask = "dash_top_left_corner_mask.png"; |
503 | + else |
504 | + left_corner_mask = "dash_bottom_left_corner_mask.png"; |
505 | + return pimpl->LoadScaledTexture(left_corner_mask, scale); |
506 | +} |
507 | + |
508 | +BaseTexturePtr Style::GetDashRightCorner(double scale, DashPosition dash_position) const |
509 | +{ |
510 | + std::string right_corner; |
511 | + if (dash_position == DashPosition::BOTTOM) |
512 | + right_corner = "dash_bottom_right_corner_rotated.png"; |
513 | + else |
514 | + right_corner = "dash_top_right_corner.png"; |
515 | + return pimpl->LoadScaledTexture(right_corner, scale); |
516 | +} |
517 | + |
518 | +BaseTexturePtr Style::GetDashRightCornerMask(double scale, DashPosition dash_position) const |
519 | +{ |
520 | + std::string right_corner_mask; |
521 | + if (dash_position == DashPosition::BOTTOM) |
522 | + right_corner_mask = "dash_bottom_right_corner_rotated_mask.png"; |
523 | + else |
524 | + right_corner_mask = "dash_top_right_corner_mask.png"; |
525 | + return pimpl->LoadScaledTexture(right_corner_mask, scale); |
526 | } |
527 | |
528 | BaseTexturePtr Style::GetSearchMagnifyIcon(double scale) const |
529 | |
530 | === modified file 'unity-shared/DashStyle.h' |
531 | --- unity-shared/DashStyle.h 2016-03-10 10:09:12 +0000 |
532 | +++ unity-shared/DashStyle.h 2016-03-18 07:01:34 +0000 |
533 | @@ -85,6 +85,10 @@ |
534 | NONE |
535 | }; |
536 | |
537 | +enum class DashPosition { |
538 | + LEFT, |
539 | + BOTTOM |
540 | +}; |
541 | |
542 | class Style : public StyleInterface |
543 | { |
544 | @@ -168,19 +172,19 @@ |
545 | BaseTexturePtr const& GetCategoryBackground() const; |
546 | BaseTexturePtr const& GetCategoryBackgroundNoFilters() const; |
547 | |
548 | - BaseTexturePtr GetDashBottomTile(double scale) const; |
549 | - BaseTexturePtr GetDashBottomTileMask(double scale) const; |
550 | + BaseTexturePtr GetDashHorizontalTile(double scale, DashPosition dash_position) const; |
551 | + BaseTexturePtr GetDashHorizontalTileMask(double scale, DashPosition dash_position) const; |
552 | BaseTexturePtr GetDashRightTile(double scale) const; |
553 | BaseTexturePtr GetDashRightTileMask(double scale) const; |
554 | BaseTexturePtr GetDashLeftTile(double scale) const; |
555 | - BaseTexturePtr GetDashTopTile(double scale) const; |
556 | + BaseTexturePtr GetDashTopOrBottomTile(double scale, DashPosition dash_position) const; |
557 | |
558 | - BaseTexturePtr GetDashCorner(double scale) const; |
559 | - BaseTexturePtr GetDashCornerMask(double scale) const; |
560 | - BaseTexturePtr GetDashLeftCorner(double scale) const; |
561 | - BaseTexturePtr GetDashLeftCornerMask(double scale) const; |
562 | - BaseTexturePtr GetDashTopCorner(double scale) const; |
563 | - BaseTexturePtr GetDashTopCornerMask(double scale) const; |
564 | + BaseTexturePtr GetDashCorner(double scale, DashPosition dash_position) const; |
565 | + BaseTexturePtr GetDashCornerMask(double scale, DashPosition dash_position) const; |
566 | + BaseTexturePtr GetDashLeftCorner(double scale, DashPosition dash_position) const; |
567 | + BaseTexturePtr GetDashLeftCornerMask(double scale, DashPosition dash_position) const; |
568 | + BaseTexturePtr GetDashRightCorner(double scale, DashPosition dash_position) const; |
569 | + BaseTexturePtr GetDashRightCornerMask(double scale, DashPosition dash_position) const; |
570 | |
571 | RawPixel GetDashHorizontalBorderHeight() const; |
572 | RawPixel GetDashVerticalBorderWidth() const; |
573 | |
574 | === modified file 'unity-shared/OverlayRenderer.cpp' |
575 | --- unity-shared/OverlayRenderer.cpp 2015-04-21 15:12:02 +0000 |
576 | +++ unity-shared/OverlayRenderer.cpp 2016-03-18 07:01:34 +0000 |
577 | @@ -26,7 +26,9 @@ |
578 | |
579 | #include "DashStyle.h" |
580 | #include "unity-shared/BackgroundEffectHelper.h" |
581 | +#include "unity-shared/PanelStyle.h" |
582 | #include "unity-shared/UnitySettings.h" |
583 | +#include "unity-shared/UScreen.h" |
584 | #include "unity-shared/WindowManager.h" |
585 | |
586 | |
587 | @@ -75,19 +77,19 @@ |
588 | |
589 | std::unique_ptr<nux::TextureLayer> bg_refine_gradient_; |
590 | |
591 | - nux::ObjectPtr<nux::BaseTexture> bottom_texture_; |
592 | - nux::ObjectPtr<nux::BaseTexture> bottom_texture_mask_; |
593 | + nux::ObjectPtr<nux::BaseTexture> horizontal_texture_; |
594 | + nux::ObjectPtr<nux::BaseTexture> horizontal_texture_mask_; |
595 | nux::ObjectPtr<nux::BaseTexture> right_texture_; |
596 | nux::ObjectPtr<nux::BaseTexture> right_texture_mask_; |
597 | nux::ObjectPtr<nux::BaseTexture> left_texture_; |
598 | - nux::ObjectPtr<nux::BaseTexture> top_texture_; |
599 | + nux::ObjectPtr<nux::BaseTexture> top_bottom_texture_; |
600 | |
601 | nux::ObjectPtr<nux::BaseTexture> corner_; |
602 | nux::ObjectPtr<nux::BaseTexture> corner_mask_; |
603 | nux::ObjectPtr<nux::BaseTexture> left_corner_; |
604 | nux::ObjectPtr<nux::BaseTexture> left_corner_mask_; |
605 | - nux::ObjectPtr<nux::BaseTexture> top_corner_; |
606 | - nux::ObjectPtr<nux::BaseTexture> top_corner_mask_; |
607 | + nux::ObjectPtr<nux::BaseTexture> right_corner_; |
608 | + nux::ObjectPtr<nux::BaseTexture> right_corner_mask_; |
609 | |
610 | // temporary variable that stores the number of backgrounds we have rendered |
611 | int bgs; |
612 | @@ -116,7 +118,9 @@ |
613 | { |
614 | parent->scale = Settings::Instance().em()->DPIScale(); |
615 | parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures))); |
616 | + parent->owner_type.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures))); |
617 | Settings::Instance().low_gfx_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures)); |
618 | + Settings::Instance().launcher_position.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures))); |
619 | |
620 | UpdateTextures(); |
621 | LoadScaledTextures(); |
622 | @@ -126,19 +130,25 @@ |
623 | { |
624 | double scale = parent->scale; |
625 | auto& style = dash::Style::Instance(); |
626 | - bottom_texture_ = style.GetDashBottomTile(scale); |
627 | - bottom_texture_mask_ = style.GetDashBottomTileMask(scale); |
628 | + dash::DashPosition dash_position; |
629 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM && parent->owner_type() == OverlayOwner::Dash) |
630 | + dash_position = dash::DashPosition::BOTTOM; |
631 | + else |
632 | + dash_position = dash::DashPosition::LEFT; |
633 | + |
634 | + horizontal_texture_ = style.GetDashHorizontalTile(scale, dash_position); |
635 | + horizontal_texture_mask_ = style.GetDashHorizontalTileMask(scale, dash_position); |
636 | right_texture_ = style.GetDashRightTile(scale); |
637 | right_texture_mask_ = style.GetDashRightTileMask(scale); |
638 | left_texture_ = style.GetDashLeftTile(scale); |
639 | - top_texture_ = style.GetDashTopTile(scale); |
640 | + top_bottom_texture_ = style.GetDashTopOrBottomTile(scale, dash_position); |
641 | |
642 | - corner_ = style.GetDashCorner(scale); |
643 | - corner_mask_ = style.GetDashCornerMask(scale); |
644 | - left_corner_ = style.GetDashLeftCorner(scale); |
645 | - left_corner_mask_ = style.GetDashLeftCornerMask(scale); |
646 | - top_corner_ = style.GetDashTopCorner(scale); |
647 | - top_corner_mask_ = style.GetDashTopCornerMask(scale); |
648 | + corner_ = style.GetDashCorner(scale, dash_position); |
649 | + corner_mask_ = style.GetDashCornerMask(scale, dash_position); |
650 | + left_corner_ = style.GetDashLeftCorner(scale, dash_position); |
651 | + left_corner_mask_ = style.GetDashLeftCornerMask(scale, dash_position); |
652 | + right_corner_ = style.GetDashRightCorner(scale, dash_position); |
653 | + right_corner_mask_ = style.GetDashRightCornerMask(scale, dash_position); |
654 | } |
655 | |
656 | void OverlayRendererImpl::OnBgColorChanged(nux::Color const& new_color) |
657 | @@ -598,7 +608,21 @@ |
658 | |
659 | if (Settings::Instance().form_factor() != FormFactor::NETBOOK || force_edges) |
660 | { |
661 | - nux::Geometry geo_border(content_geo.x, content_geo.y, larger_absolute_geo.width - content_geo.x, larger_absolute_geo.height); |
662 | + int monitor = unity::UScreen::GetDefault()->GetMonitorWithMouse(); |
663 | + nux::Geometry const& monitor_geo = unity::UScreen::GetDefault()->GetMonitorGeometry(monitor); |
664 | + int launcher_size = Settings::Instance().LauncherSize(monitor); |
665 | + int panel_height = panel::Style::Instance().PanelHeight(monitor); |
666 | + |
667 | + dash::DashPosition dash_position = dash::DashPosition::LEFT; |
668 | + int border_y = content_geo.y; |
669 | + int border_height = larger_absolute_geo.height; |
670 | + if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM && !force_edges) |
671 | + { |
672 | + border_y = panel_height; |
673 | + border_height = monitor_geo.height - launcher_size; |
674 | + dash_position = dash::DashPosition::BOTTOM; |
675 | + } |
676 | + nux::Geometry geo_border(content_geo.x, border_y, larger_absolute_geo.width - content_geo.x, border_height); |
677 | gfx_context.PushClippingRectangle(geo_border); |
678 | |
679 | // Paint the edges |
680 | @@ -608,8 +632,8 @@ |
681 | gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
682 | |
683 | nux::TexCoordXForm texxform; |
684 | - auto const& bottom = bottom_texture_; |
685 | - auto const& bottom_mask = bottom_texture_mask_; |
686 | + auto const& horizontal = horizontal_texture_; |
687 | + auto const& horizontal_mask = horizontal_texture_mask_; |
688 | auto const& right = right_texture_; |
689 | auto const& right_mask = right_texture_mask_; |
690 | auto const& corner = corner_; |
691 | @@ -617,14 +641,14 @@ |
692 | auto const& left_corner = left_corner_; |
693 | auto const& left_corner_mask = left_corner_mask_; |
694 | auto const& left_tile = left_texture_; |
695 | - auto const& top_corner = top_corner_; |
696 | - auto const& top_corner_mask = top_corner_mask_; |
697 | - auto const& top_tile = top_texture_; |
698 | + auto const& right_corner = right_corner_; |
699 | + auto const& right_corner_mask = right_corner_mask_; |
700 | + auto const& top_tile = top_bottom_texture_; |
701 | |
702 | int left_corner_offset = LEFT_CORNER_OFFSET.CP(scale); |
703 | int top_corner_offset = TOP_CORNER_OFFSET.CP(scale); |
704 | nux::Size corner_size(corner->GetWidth(), corner->GetHeight()); |
705 | - nux::Size top_corner_size(top_corner->GetWidth(), top_corner->GetHeight()); |
706 | + nux::Size right_corner_size(right_corner->GetWidth(), right_corner->GetHeight()); |
707 | nux::Size left_corner_size(left_corner->GetWidth(), left_corner->GetHeight()); |
708 | |
709 | geo.width += corner_size.width - left_corner_offset; |
710 | @@ -633,10 +657,15 @@ |
711 | // Corner |
712 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
713 | texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
714 | + int corner_y = 0; |
715 | + if (dash_position == dash::DashPosition::BOTTOM) |
716 | + corner_y = geo.y - corner_size.height + top_corner_offset; |
717 | + else |
718 | + corner_y = geo.y + (geo.height - corner_size.height); |
719 | |
720 | // Selectively erase blur region in the curbe |
721 | gfx_context.QRP_ColorModTexAlpha(geo.x + (geo.width - corner_size.width), |
722 | - geo.y + (geo.height - corner_size.height), |
723 | + corner_y, |
724 | corner_size.width, |
725 | corner_size.height, |
726 | corner_mask->GetDeviceTexture(), |
727 | @@ -647,7 +676,7 @@ |
728 | gfx_context.GetRenderStates().SetBlend(false); |
729 | gfx_context.GetRenderStates().SetColorMask(false, false, false, true); |
730 | RenderInverseMask(gfx_context, geo.x + (geo.width - corner_size.width), |
731 | - geo.y + (geo.height - corner_size.height), |
732 | + corner_y, |
733 | corner_size.width, |
734 | corner_size.height, |
735 | corner_mask->GetDeviceTexture(), |
736 | @@ -659,7 +688,7 @@ |
737 | gfx_context.GetRenderStates().SetColorMask(true, true, true, true); |
738 | |
739 | gfx_context.QRP_1Tex(geo.x + (geo.width - corner_size.width), |
740 | - geo.y + (geo.height - corner_size.height), |
741 | + corner_y, |
742 | corner_size.width, |
743 | corner_size.height, |
744 | corner->GetDeviceTexture(), |
745 | @@ -667,19 +696,24 @@ |
746 | nux::color::White); |
747 | } |
748 | { |
749 | - // Bottom repeated texture |
750 | + // Horizontal repeated texture |
751 | int real_width = geo.width - (left_corner_size.width - left_corner_offset) - corner_size.width; |
752 | - int offset = real_width % bottom->GetWidth(); |
753 | + int offset = real_width % horizontal->GetWidth(); |
754 | + int horizontal_y = 0; |
755 | + if (dash_position == dash::DashPosition::BOTTOM) |
756 | + horizontal_y = geo.y - horizontal->GetHeight() + top_corner_offset; |
757 | + else |
758 | + horizontal_y = geo.y + (geo.height - horizontal->GetHeight()); |
759 | |
760 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
761 | texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
762 | |
763 | // Selectively erase blur region in the curbe |
764 | gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset - offset, |
765 | - geo.y + (geo.height - bottom->GetHeight()), |
766 | + horizontal_y, |
767 | real_width + offset, |
768 | - bottom->GetHeight(), |
769 | - bottom_mask->GetDeviceTexture(), |
770 | + horizontal->GetHeight(), |
771 | + horizontal_mask->GetDeviceTexture(), |
772 | texxform, |
773 | nux::color::Black); |
774 | |
775 | @@ -687,10 +721,10 @@ |
776 | gfx_context.GetRenderStates().SetBlend(false); |
777 | gfx_context.GetRenderStates().SetColorMask(false, false, false, true); |
778 | RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset - offset, |
779 | - geo.y + (geo.height - bottom->GetHeight()), |
780 | + horizontal_y, |
781 | real_width + offset, |
782 | - bottom->GetHeight(), |
783 | - bottom_mask->GetDeviceTexture(), |
784 | + horizontal->GetHeight(), |
785 | + horizontal_mask->GetDeviceTexture(), |
786 | texxform, |
787 | nux::color::White); |
788 | |
789 | @@ -699,44 +733,52 @@ |
790 | gfx_context.GetRenderStates().SetColorMask(true, true, true, true); |
791 | |
792 | gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset - offset, |
793 | - geo.y + (geo.height - bottom->GetHeight()), |
794 | + horizontal_y, |
795 | real_width + offset, |
796 | - bottom->GetHeight(), |
797 | - bottom->GetDeviceTexture(), |
798 | + horizontal->GetHeight(), |
799 | + horizontal->GetDeviceTexture(), |
800 | texxform, |
801 | nux::color::White); |
802 | } |
803 | { |
804 | - // Bottom left corner |
805 | + // Bottom left or top left corner |
806 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
807 | texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
808 | - |
809 | - // Selectively erase blur region in the curbe |
810 | - gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset, |
811 | - geo.y + (geo.height - left_corner_size.height), |
812 | - left_corner_size.width, |
813 | - left_corner_size.height, |
814 | - left_corner_mask->GetDeviceTexture(), |
815 | - texxform, |
816 | - nux::color::Black); |
817 | - |
818 | - // Write correct alpha |
819 | - gfx_context.GetRenderStates().SetBlend(false); |
820 | - gfx_context.GetRenderStates().SetColorMask(false, false, false, true); |
821 | - RenderInverseMask(gfx_context, geo.x - left_corner_offset, |
822 | - geo.y + (geo.height - left_corner_size.height), |
823 | - left_corner_size.width, |
824 | - left_corner_size.height, |
825 | - left_corner_mask->GetDeviceTexture(), |
826 | - texxform, |
827 | - nux::color::White); |
828 | + int left_corner_y = 0; |
829 | + if (dash_position == dash::DashPosition::BOTTOM) |
830 | + left_corner_y = geo.y - left_corner_size.height + top_corner_offset; |
831 | + else |
832 | + left_corner_y = geo.y + (geo.height - left_corner_size.height); |
833 | + |
834 | + if (dash_position == dash::DashPosition::LEFT) |
835 | + { |
836 | + // Selectively erase blur region in the curbe |
837 | + gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset, |
838 | + left_corner_y, |
839 | + left_corner_size.width, |
840 | + left_corner_size.height, |
841 | + left_corner_mask->GetDeviceTexture(), |
842 | + texxform, |
843 | + nux::color::Black); |
844 | + |
845 | + // Write correct alpha |
846 | + gfx_context.GetRenderStates().SetBlend(false); |
847 | + gfx_context.GetRenderStates().SetColorMask(false, false, false, true); |
848 | + RenderInverseMask(gfx_context, geo.x - left_corner_offset, |
849 | + left_corner_y, |
850 | + left_corner_size.width, |
851 | + left_corner_size.height, |
852 | + left_corner_mask->GetDeviceTexture(), |
853 | + texxform, |
854 | + nux::color::White); |
855 | + } |
856 | |
857 | gfx_context.GetRenderStates().SetBlend(true); |
858 | gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
859 | gfx_context.GetRenderStates().SetColorMask(true, true, true, true); |
860 | |
861 | gfx_context.QRP_1Tex(geo.x - left_corner_offset, |
862 | - geo.y + (geo.height - left_corner_size.height), |
863 | + left_corner_y, |
864 | left_corner_size.width, |
865 | left_corner_size.height, |
866 | left_corner->GetDeviceTexture(), |
867 | @@ -748,12 +790,27 @@ |
868 | nux::Geometry real_geo = geometry; |
869 | int real_height = real_geo.height - geo.height; |
870 | int offset = real_height % left_tile->GetHeight(); |
871 | + int left_texture_y = 0; |
872 | + if (dash_position == dash::DashPosition::BOTTOM) |
873 | + { |
874 | + left_texture_y = panel_height; |
875 | + real_height = monitor_geo.height - launcher_size - content_geo.height - left_corner->GetHeight() - panel_height + top_corner_offset; |
876 | + } |
877 | + else if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM) |
878 | + { |
879 | + left_texture_y = geo.y + geo.height; |
880 | + real_height -= launcher_size; |
881 | + } |
882 | + else |
883 | + { |
884 | + left_texture_y = geo.y + geo.height; |
885 | + } |
886 | |
887 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
888 | texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
889 | |
890 | gfx_context.QRP_1Tex(geo.x - left_corner_offset, |
891 | - geo.y + geo.height, |
892 | + left_texture_y, |
893 | left_tile->GetWidth(), |
894 | real_height + offset, |
895 | left_tile->GetDeviceTexture(), |
896 | @@ -764,12 +821,17 @@ |
897 | // Right edge |
898 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
899 | texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
900 | + int right_edge_y = 0; |
901 | + if (dash_position == dash::DashPosition::BOTTOM) |
902 | + right_edge_y = geo.y + top_corner_offset; |
903 | + else |
904 | + right_edge_y = geo.y + right_corner_size.height - top_corner_offset; |
905 | |
906 | // Selectively erase blur region in the curbe |
907 | gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(), |
908 | - geo.y + top_corner_size.height - top_corner_offset, |
909 | + right_edge_y, |
910 | right->GetWidth(), |
911 | - geo.height - corner_size.height - (top_corner_size.height - top_corner_offset), |
912 | + geo.height - corner_size.height - (right_corner_size.height - top_corner_offset), |
913 | right_mask->GetDeviceTexture(), |
914 | texxform, |
915 | nux::color::Black); |
916 | @@ -778,9 +840,9 @@ |
917 | gfx_context.GetRenderStates().SetBlend(false); |
918 | gfx_context.GetRenderStates().SetColorMask(false, false, false, true); |
919 | RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(), |
920 | - geo.y + top_corner_size.height - top_corner_offset, |
921 | + right_edge_y, |
922 | right->GetWidth(), |
923 | - geo.height - corner_size.height - (top_corner_size.height - top_corner_offset), |
924 | + geo.height - corner_size.height - (right_corner_size.height - top_corner_offset), |
925 | right_mask->GetDeviceTexture(), |
926 | texxform, |
927 | nux::color::White); |
928 | @@ -790,24 +852,29 @@ |
929 | gfx_context.GetRenderStates().SetColorMask(true, true, true, true); |
930 | |
931 | gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(), |
932 | - geo.y + top_corner_size.height - top_corner_offset, |
933 | + right_edge_y, |
934 | right->GetWidth(), |
935 | - geo.height - corner_size.height - (top_corner_size.height - top_corner_offset), |
936 | + geo.height - corner_size.height - (right_corner_size.height - top_corner_offset), |
937 | right->GetDeviceTexture(), |
938 | texxform, |
939 | nux::color::White); |
940 | } |
941 | { |
942 | - // Top right corner |
943 | + // Top right or bottom right corner |
944 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
945 | texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER); |
946 | + int right_corner_y = 0; |
947 | + if (dash_position == dash::DashPosition::BOTTOM) |
948 | + right_corner_y = geo.y + content_geo.height - right_corner_size.height + top_corner_offset; |
949 | + else |
950 | + right_corner_y = geo.y - top_corner_offset; |
951 | |
952 | // Selectively erase blur region in the curbe |
953 | gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(), |
954 | - geo.y - top_corner_offset, |
955 | - top_corner_size.width, |
956 | - top_corner_size.height, |
957 | - top_corner_mask->GetDeviceTexture(), |
958 | + right_corner_y, |
959 | + right_corner_size.width, |
960 | + right_corner_size.height, |
961 | + right_corner_mask->GetDeviceTexture(), |
962 | texxform, |
963 | nux::color::Black); |
964 | |
965 | @@ -815,10 +882,10 @@ |
966 | gfx_context.GetRenderStates().SetBlend(false); |
967 | gfx_context.GetRenderStates().SetColorMask(false, false, false, true); |
968 | RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(), |
969 | - geo.y - top_corner_offset, |
970 | - top_corner_size.width, |
971 | - top_corner_size.height, |
972 | - top_corner_mask->GetDeviceTexture(), |
973 | + right_corner_y, |
974 | + right_corner_size.width, |
975 | + right_corner_size.height, |
976 | + right_corner_mask->GetDeviceTexture(), |
977 | texxform, |
978 | nux::color::White); |
979 | |
980 | @@ -826,21 +893,26 @@ |
981 | gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
982 | gfx_context.GetRenderStates().SetColorMask(true, true, true, true); |
983 | gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(), |
984 | - geo.y - top_corner_offset, |
985 | - top_corner_size.width, |
986 | - top_corner_size.height, |
987 | - top_corner->GetDeviceTexture(), |
988 | + right_corner_y, |
989 | + right_corner_size.width, |
990 | + right_corner_size.height, |
991 | + right_corner->GetDeviceTexture(), |
992 | texxform, |
993 | nux::color::White); |
994 | } |
995 | { |
996 | - // Top edge |
997 | + // Top or bottom edge |
998 | texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
999 | texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT); |
1000 | + int y = 0; |
1001 | + if (dash_position == dash::DashPosition::BOTTOM) |
1002 | + y = geo.y + content_geo.height - top_tile->GetHeight() + top_corner_offset; |
1003 | + else |
1004 | + y = geo.y - top_corner_offset; |
1005 | |
1006 | gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER); |
1007 | gfx_context.QRP_1Tex(geo.x + geo.width, |
1008 | - geo.y - top_corner_offset, |
1009 | + y, |
1010 | geometry.width - (geo.x + geo.width), |
1011 | top_tile->GetHeight(), |
1012 | top_tile->GetDeviceTexture(), |
1013 | |
1014 | === modified file 'unity-shared/OverlayRenderer.h' |
1015 | --- unity-shared/OverlayRenderer.h 2014-07-08 13:46:29 +0000 |
1016 | +++ unity-shared/OverlayRenderer.h 2016-03-18 07:01:34 +0000 |
1017 | @@ -29,6 +29,12 @@ |
1018 | namespace unity |
1019 | { |
1020 | |
1021 | +enum class OverlayOwner |
1022 | +{ |
1023 | + Dash = 0, |
1024 | + Hud |
1025 | +}; |
1026 | + |
1027 | class OverlayRendererImpl; |
1028 | class OverlayRenderer |
1029 | { |
1030 | @@ -40,6 +46,7 @@ |
1031 | nux::Property<int> x_offset; |
1032 | nux::Property<int> y_offset; |
1033 | nux::Property<double> scale; |
1034 | + nux::Property<OverlayOwner> owner_type; |
1035 | |
1036 | OverlayRenderer(); |
1037 | ~OverlayRenderer(); |
1038 | |
1039 | === modified file 'unity-shared/UBusMessages.h' |
1040 | --- unity-shared/UBusMessages.h 2015-04-15 15:45:22 +0000 |
1041 | +++ unity-shared/UBusMessages.h 2016-03-18 07:01:34 +0000 |
1042 | @@ -41,6 +41,9 @@ |
1043 | // get rid of keyboard-input-focus |
1044 | #define UBUS_LAUNCHER_START_KEY_NAV "LAUNCHER_START_KEY_NAV" |
1045 | #define UBUS_LAUNCHER_END_KEY_NAV "LAUNCHER_END_KEY_NAV" |
1046 | +#define UBUS_LAUNCHER_PREV_KEY_NAV "LAUNCHER_PREV_KEY_NAV" |
1047 | +#define UBUS_LAUNCHER_NEXT_KEY_NAV "LAUNCHER_NEXT_KEY_NAV" |
1048 | +#define UBUS_LAUNCHER_OPEN_QUICKLIST "LAUNCHER_OPEN_QUICKLIST" |
1049 | #define UBUS_LAUNCHER_START_KEY_SWITCHER "LAUNCHER_START_KEY_SWITCHER" |
1050 | #define UBUS_LAUNCHER_END_KEY_SWITCHER "LAUNCHER_END_KEY_SWITCHER" |
1051 | #define UBUS_LAUNCHER_SELECTION_CHANGED "LAUNCHER_ICON_SELECTION_CHANGED" |
Please revert the changes to PanelView, because some reasons:
1) You should disconnect from form_factor changes (or expect crashes)
2) The way is done right now will affect Hud as well
3) After thinking again, I've the impression that it's better to keep the
panel blurred, also when the dash is at the bottom, because it's a way
to underline that panel is controlling the dash.
So, other than that (and the small change in OverlayRenderer and DashStyle if you want) I think we're ok to go.