Merge lp:~feng-kylin/unity/MoveDashToBottom into lp:unity

Proposed by handsome_feng
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
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.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

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.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ah, also this black edge: http://i.imgur.com/OyNzmFz.png

This can be fixed even later, but I guess it's just about to use the proper mask.

Revision history for this message
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_keybindings.WindowManagerKeybindingsForWindowHandling.test_right_maximize
and test_left_maximize, the self.screen_win.height didn't match workarea_geo[3].
There is a 2 pixels difference... :/

and BTW, how about the bug of overlapped tooltip ?

Revision history for this message
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_keybindings.WindowManag
> erKeybindingsForWindowHandling.test_right_maximize
> and test_left_maximize, the self.screen_win.height didn't match
> 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.

review: Approve
Revision history for this message
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://pastebin.ubuntu.com/15391195/

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 AbstractLauncherIcon maybe it's better if you add a new "virtual void PromptHideTooltip()" or better.

But this should give you an idea.

Revision history for this message
handsome_feng (feng-kylin) wrote :

I apply the diff , but the unity will crash when call "animation::Skip(fade_animator_)", :/

Revision history for this message
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://pastebin.ubuntu.com/15407034/

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 :)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Err fixed some white spacing: http://pastebin.ubuntu.com/15407037/

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Again... Fixing the double-blur thing was just about calling PromptHide, so this is what you need: http://pastebin.ubuntu.com/15407049/

Feel free to clean this up by adding methods, if you want.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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/+merge/281182, please merge this with that as well.

Done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dash/DashController.cpp'
--- dash/DashController.cpp 2016-03-18 07:01:34 +0000
+++ dash/DashController.cpp 2016-03-18 07:01:34 +0000
@@ -230,22 +230,22 @@
230nux::Geometry Controller::GetIdealWindowGeometry()230nux::Geometry Controller::GetIdealWindowGeometry()
231{231{
232 UScreen *uscreen = UScreen::GetDefault();232 UScreen *uscreen = UScreen::GetDefault();
233 auto ideal_geo = uscreen->GetMonitorGeometry(GetIdealMonitor());233 auto monitor_geo = uscreen->GetMonitorGeometry(GetIdealMonitor());
234 int launcher_size = unity::Settings::Instance().LauncherSize(monitor_);234 int launcher_size = unity::Settings::Instance().LauncherSize(monitor_);
235235
236 // We want to cover as much of the screen as possible to grab any mouse events outside236 // We want to cover as much of the screen as possible to grab any mouse events outside
237 // of our window237 // of our window
238 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)238 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
239 {239 {
240 ideal_geo.x += launcher_size;240 monitor_geo.x += launcher_size;
241 ideal_geo.width -= launcher_size;241 monitor_geo.width -= launcher_size;
242 }242 }
243 else243 else
244 {244 {
245 ideal_geo.height -= launcher_size;245 monitor_geo.height -= launcher_size;
246 }246 }
247247
248 return ideal_geo;248 return monitor_geo;
249}249}
250250
251void Controller::OnMonitorChanged(int primary, std::vector<nux::Geometry> const& monitors)251void Controller::OnMonitorChanged(int primary, std::vector<nux::Geometry> const& monitors)
@@ -278,6 +278,12 @@
278 {278 {
279 left_offset = launcher_size;279 left_offset = launcher_size;
280 }280 }
281 else if (launcher_position == LauncherPosition::BOTTOM &&
282 Settings::Instance().form_factor() == FormFactor::DESKTOP)
283 {
284 auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor_);
285 top_offset = monitor_geo.height - view_->GetContentGeometry().height - launcher_size;
286 }
281287
282 view_->SetMonitorOffset(left_offset, top_offset);288 view_->SetMonitorOffset(left_offset, top_offset);
283}289}
@@ -489,6 +495,8 @@
489nux::Geometry Controller::GetInputWindowGeometry()495nux::Geometry Controller::GetInputWindowGeometry()
490{496{
491 EnsureDash();497 EnsureDash();
498 int launcher_size = Settings::Instance().LauncherSize(monitor_);
499 auto const& monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor_);
492 dash::Style& style = dash::Style::Instance();500 dash::Style& style = dash::Style::Instance();
493 nux::Geometry const& window_geo(window_->GetGeometry());501 nux::Geometry const& window_geo(window_->GetGeometry());
494 nux::Geometry const& view_content_geo(view_->GetContentGeometry());502 nux::Geometry const& view_content_geo(view_->GetContentGeometry());
@@ -499,6 +507,15 @@
499 {507 {
500 geo.width += style.GetDashVerticalBorderWidth().CP(view_->scale());508 geo.width += style.GetDashVerticalBorderWidth().CP(view_->scale());
501 geo.height += style.GetDashHorizontalBorderHeight().CP(view_->scale());509 geo.height += style.GetDashHorizontalBorderHeight().CP(view_->scale());
510
511 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
512 geo.y = monitor_geo.height - view_content_geo.height - launcher_size - style.GetDashHorizontalBorderHeight().CP(view_->scale());
513 }
514 else if (Settings::Instance().form_factor() == FormFactor::NETBOOK)
515 {
516 geo.height = monitor_geo.height;
517 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
518 geo.height -= launcher_size;
502 }519 }
503520
504 return geo;521 return geo;
505522
=== modified file 'dash/DashView.cpp'
--- dash/DashView.cpp 2016-02-17 18:40:53 +0000
+++ dash/DashView.cpp 2016-03-18 07:01:34 +0000
@@ -133,6 +133,7 @@
133 , monitor_(0)133 , monitor_(0)
134{134{
135 renderer_.SetOwner(this);135 renderer_.SetOwner(this);
136 renderer_.owner_type = OverlayOwner::Dash;
136 renderer_.need_redraw.connect([this] () {137 renderer_.need_redraw.connect([this] () {
137 QueueDraw();138 QueueDraw();
138 });139 });
@@ -650,7 +651,20 @@
650 ubus_manager_.SendMessage(UBUS_DASH_SIZE_CHANGED, g_variant_new("(ii)", content_geo_.width, content_geo_.height));651 ubus_manager_.SendMessage(UBUS_DASH_SIZE_CHANGED, g_variant_new("(ii)", content_geo_.width, content_geo_.height));
651652
652 if (preview_displaying_)653 if (preview_displaying_)
653 preview_container_->SetGeometry(layout_->GetGeometry());654 {
655 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
656 {
657 auto preview_geo = content_geo_;
658 int padding = style.GetDashHorizontalBorderHeight().CP(scale());
659 preview_geo.y += padding;
660 preview_geo.height -= padding;
661 preview_container_->SetGeometry(preview_geo);
662 }
663 else
664 {
665 preview_container_->SetGeometry(layout_->GetGeometry());
666 }
667 }
654668
655 renderer_.UpdateBlurBackgroundSize(content_geo_, GetRenderAbsoluteGeometry(), false);669 renderer_.UpdateBlurBackgroundSize(content_geo_, GetRenderAbsoluteGeometry(), false);
656670
@@ -729,6 +743,8 @@
729 // See lp bug: 1125346 (The sharp white line between dash and launcher is missing)743 // See lp bug: 1125346 (The sharp white line between dash and launcher is missing)
730 nux::Geometry clip_geo = geo_layout;744 nux::Geometry clip_geo = geo_layout;
731 clip_geo.x += 1;745 clip_geo.x += 1;
746 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
747 clip_geo.y += renderer_y_offset;
732 graphics_engine.PushClippingRectangle(clip_geo);748 graphics_engine.PushClippingRectangle(clip_geo);
733749
734 if (IsFullRedraw())750 if (IsFullRedraw())
735751
=== modified file 'hud/HudView.cpp'
--- hud/HudView.cpp 2014-07-11 01:45:24 +0000
+++ hud/HudView.cpp 2016-03-18 07:01:34 +0000
@@ -73,6 +73,7 @@
73 scale = Settings::Instance().em()->DPIScale();73 scale = Settings::Instance().em()->DPIScale();
74 renderer_.scale = scale();74 renderer_.scale = scale();
75 renderer_.SetOwner(this);75 renderer_.SetOwner(this);
76 renderer_.owner_type = OverlayOwner::Hud;
76 renderer_.need_redraw.connect([this] () {77 renderer_.need_redraw.connect([this] () {
77 QueueDraw();78 QueueDraw();
78 });79 });
7980
=== modified file 'launcher/AbstractLauncherIcon.h'
--- launcher/AbstractLauncherIcon.h 2015-11-25 23:16:11 +0000
+++ launcher/AbstractLauncherIcon.h 2016-03-18 07:01:34 +0000
@@ -144,6 +144,7 @@
144144
145 virtual void ShowTooltip() = 0;145 virtual void ShowTooltip() = 0;
146 virtual void HideTooltip() = 0;146 virtual void HideTooltip() = 0;
147 virtual void PromptHideTooltip() = 0;
147148
148 virtual void SetShortcut(guint64 shortcut) = 0;149 virtual void SetShortcut(guint64 shortcut) = 0;
149150
150151
=== modified file 'launcher/CairoBaseWindow.cpp'
--- launcher/CairoBaseWindow.cpp 2014-02-25 18:41:37 +0000
+++ launcher/CairoBaseWindow.cpp 2016-03-18 07:01:34 +0000
@@ -73,6 +73,12 @@
73 animation::StartOrReverse(fade_animator_, animation::Direction::BACKWARD);73 animation::StartOrReverse(fade_animator_, animation::Direction::BACKWARD);
74}74}
7575
76void CairoBaseWindow::PromptHide()
77{
78 Hide();
79 fade_animator_.Stop();
80}
81
76void CairoBaseWindow::RedrawBlur()82void CairoBaseWindow::RedrawBlur()
77{83{
78 compute_blur_bkg_ = true;84 compute_blur_bkg_ = true;
7985
=== modified file 'launcher/CairoBaseWindow.h'
--- launcher/CairoBaseWindow.h 2014-02-25 18:41:37 +0000
+++ launcher/CairoBaseWindow.h 2016-03-18 07:01:34 +0000
@@ -35,6 +35,7 @@
3535
36 virtual void Show();36 virtual void Show();
37 virtual void Hide();37 virtual void Hide();
38 void PromptHide();
3839
39 void RedrawBlur();40 void RedrawBlur();
40 bool HasBlurredBackground() const;41 bool HasBlurredBackground() const;
4142
=== modified file 'launcher/Launcher.h'
--- launcher/Launcher.h 2016-03-18 07:01:34 +0000
+++ launcher/Launcher.h 2016-03-18 07:01:34 +0000
@@ -43,7 +43,6 @@
43#include "LauncherHoverMachine.h"43#include "LauncherHoverMachine.h"
44#include "unity-shared/MockableBaseWindow.h"44#include "unity-shared/MockableBaseWindow.h"
45#include "unity-shared/UBusWrapper.h"45#include "unity-shared/UBusWrapper.h"
46#include "unity-shared/UnitySettings.h"
47#include "SoftwareCenterLauncherIcon.h"46#include "SoftwareCenterLauncherIcon.h"
48#include "TooltipManager.h"47#include "TooltipManager.h"
4948
@@ -54,6 +53,8 @@
5453
55namespace unity54namespace unity
56{55{
56enum class LauncherPosition;
57
57namespace launcher58namespace launcher
58{59{
59extern const char* window_title;60extern const char* window_title;
6061
=== modified file 'launcher/LauncherController.cpp'
--- launcher/LauncherController.cpp 2016-03-18 07:01:34 +0000
+++ launcher/LauncherController.cpp 2016-03-18 07:01:34 +0000
@@ -180,6 +180,18 @@
180 }180 }
181 });181 });
182182
183 ubus.RegisterInterest(UBUS_LAUNCHER_NEXT_KEY_NAV, [this] (GVariant*) {
184 parent_->KeyNavNext();
185 });
186
187 ubus.RegisterInterest(UBUS_LAUNCHER_PREV_KEY_NAV, [this] (GVariant*) {
188 parent_->KeyNavPrevious();
189 });
190
191 ubus.RegisterInterest(UBUS_LAUNCHER_OPEN_QUICKLIST, [this] (GVariant*) {
192 OpenQuicklist();
193 });
194
183 parent_->AddChild(model_.get());195 parent_->AddChild(model_.get());
184196
185 xdnd_manager_->dnd_started.connect(sigc::mem_fun(this, &Impl::OnDndStarted));197 xdnd_manager_->dnd_started.connect(sigc::mem_fun(this, &Impl::OnDndStarted));
186198
=== modified file 'launcher/LauncherIcon.cpp'
--- launcher/LauncherIcon.cpp 2016-03-18 07:01:34 +0000
+++ launcher/LauncherIcon.cpp 2016-03-18 07:01:34 +0000
@@ -645,6 +645,14 @@
645 tooltip_visible.emit(nux::ObjectPtr<nux::View>());645 tooltip_visible.emit(nux::ObjectPtr<nux::View>());
646}646}
647647
648void LauncherIcon::PromptHideTooltip()
649{
650 if (_tooltip)
651 _tooltip->PromptHide();
652
653 tooltip_visible.emit(nux::ObjectPtr<nux::View>());
654}
655
648void LauncherIcon::SetCenter(nux::Point3 const& new_center, int monitor)656void LauncherIcon::SetCenter(nux::Point3 const& new_center, int monitor)
649{657{
650 nux::Point3& center = _center[monitor];658 nux::Point3& center = _center[monitor];
651659
=== modified file 'launcher/LauncherIcon.h'
--- launcher/LauncherIcon.h 2016-02-25 15:59:41 +0000
+++ launcher/LauncherIcon.h 2016-03-18 07:01:34 +0000
@@ -70,6 +70,7 @@
70 void RecvMouseClick(int button, int monitor, unsigned long key_flags = 0);70 void RecvMouseClick(int button, int monitor, unsigned long key_flags = 0);
7171
72 void HideTooltip();72 void HideTooltip();
73 void PromptHideTooltip();
7374
74 void ShowTooltip();75 void ShowTooltip();
7576
7677
=== modified file 'launcher/MockLauncherIcon.h'
--- launcher/MockLauncherIcon.h 2015-11-25 23:16:11 +0000
+++ launcher/MockLauncherIcon.h 2016-03-18 07:01:34 +0000
@@ -87,6 +87,7 @@
8787
88 void ShowTooltip() { is_tooltip_visible_ = true; }88 void ShowTooltip() { is_tooltip_visible_ = true; }
89 void HideTooltip() { is_tooltip_visible_ = false; }89 void HideTooltip() { is_tooltip_visible_ = false; }
90 void PromptHideTooltip() { is_tooltip_visible_ = false; }
90 bool IsTooltipVisible() { return is_tooltip_visible_; }91 bool IsTooltipVisible() { return is_tooltip_visible_; }
9192
92 void SetShortcut(guint64 shortcut) {}93 void SetShortcut(guint64 shortcut) {}
9394
=== modified file 'launcher/QuicklistView.cpp'
--- launcher/QuicklistView.cpp 2016-03-18 07:01:34 +0000
+++ launcher/QuicklistView.cpp 2016-03-18 07:01:34 +0000
@@ -325,7 +325,32 @@
325 // left (close quicklist, go back to laucher key-nav)325 // left (close quicklist, go back to laucher key-nav)
326 case NUX_VK_LEFT:326 case NUX_VK_LEFT:
327 case NUX_KP_LEFT:327 case NUX_KP_LEFT:
328 HideAndEndQuicklistNav();328
329 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
330 {
331 PromptHide();
332 UBusManager::SendMessage(UBUS_QUICKLIST_END_KEY_NAV);
333 UBusManager::SendMessage(UBUS_LAUNCHER_PREV_KEY_NAV);
334 UBusManager::SendMessage(UBUS_LAUNCHER_OPEN_QUICKLIST);
335 }
336 else
337 {
338 HideAndEndQuicklistNav();
339 }
340
341 break;
342
343 // right (close quicklist, go back to launcher key-nav)
344 case NUX_VK_RIGHT:
345 case NUX_KP_RIGHT:
346 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
347 {
348 PromptHide();
349 UBusManager::SendMessage(UBUS_QUICKLIST_END_KEY_NAV);
350 UBusManager::SendMessage(UBUS_LAUNCHER_NEXT_KEY_NAV);
351 UBusManager::SendMessage(UBUS_LAUNCHER_OPEN_QUICKLIST);
352 }
353
329 break;354 break;
330355
331 // esc (close quicklist, exit key-nav)356 // esc (close quicklist, exit key-nav)
332357
=== modified file 'launcher/SoftwareCenterLauncherIcon.cpp'
--- launcher/SoftwareCenterLauncherIcon.cpp 2016-03-18 07:01:34 +0000
+++ launcher/SoftwareCenterLauncherIcon.cpp 2016-02-23 15:39:49 +0000
@@ -31,7 +31,6 @@
31#include "LauncherDragWindow.h"31#include "LauncherDragWindow.h"
32#include "LauncherModel.h"32#include "LauncherModel.h"
33#include "DesktopUtilities.h"33#include "DesktopUtilities.h"
34#include "unity-shared/UnitySettings.h"
3534
36namespace unity35namespace unity
37{36{
3837
=== modified file 'launcher/TooltipManager.cpp'
--- launcher/TooltipManager.cpp 2013-11-14 03:00:29 +0000
+++ launcher/TooltipManager.cpp 2016-03-18 07:01:34 +0000
@@ -19,6 +19,7 @@
19 */19 */
2020
21#include "TooltipManager.h"21#include "TooltipManager.h"
22#include "unity-shared/UnitySettings.h"
2223
23namespace unity24namespace unity
24{25{
@@ -40,7 +41,12 @@
4041
41 StopTimer();42 StopTimer();
42 if (icon_)43 if (icon_)
43 icon_->HideTooltip();44 {
45 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
46 icon_->HideTooltip();
47 else
48 icon_->PromptHideTooltip();
49 }
4450
45 icon_ = icon_under_mouse;51 icon_ = icon_under_mouse;
4652
4753
=== added file 'resources/dash_bottom_right_corner_rotated.png'
48Binary 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 differ54Binary 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
=== added file 'resources/dash_bottom_right_corner_rotated_mask.png'
49Binary 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 differ55Binary 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
=== added file 'resources/dash_bottom_tile.png'
50Binary 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 differ56Binary 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
=== added file 'resources/dash_top_border_tile.png'
51Binary 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 differ57Binary 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
=== added file 'resources/dash_top_border_tile_mask.png'
52Binary 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 differ58Binary 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
=== added file 'resources/dash_top_left_corner.png'
53Binary 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 differ59Binary 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
=== added file 'resources/dash_top_left_corner_mask.png'
54Binary 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 differ60Binary 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
=== added file 'resources/dash_top_right_corner_rotated.png'
55Binary 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 differ61Binary 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
=== added file 'resources/dash_top_right_corner_rotated_mask.png'
56Binary 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 differ62Binary 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
=== modified file 'tests/autopilot/unity/tests/launcher/test_keynav.py'
--- tests/autopilot/unity/tests/launcher/test_keynav.py 2016-03-18 07:01:34 +0000
+++ tests/autopilot/unity/tests/launcher/test_keynav.py 2016-03-18 07:01:34 +0000
@@ -13,6 +13,7 @@
13import logging13import logging
14from testtools.matchers import Equals, GreaterThan14from testtools.matchers import Equals, GreaterThan
1515
16from unity.emulators.launcher import LauncherPosition
16from unity.tests.launcher import LauncherTestCase17from unity.tests.launcher import LauncherTestCase
1718
18logger = logging.getLogger(__name__)19logger = logging.getLogger(__name__)
@@ -114,10 +115,12 @@
114 self.addCleanup(self.keyboard.press_and_release, "Escape")115 self.addCleanup(self.keyboard.press_and_release, "Escape")
115 self.launcher_instance.key_nav_enter_quicklist(self.launcher_position)116 self.launcher_instance.key_nav_enter_quicklist(self.launcher_position)
116 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True)))117 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True)))
117 self.launcher_instance.key_nav_exit_quicklist()118 # We can't close a quicklist from keynav mode when launcher at bottom.
118 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(False)))119 if self.launcher_position == LauncherPosition.LEFT:
119 self.assertThat(self.unity.launcher.key_nav_is_active, Eventually(Equals(True)))120 self.launcher_instance.key_nav_exit_quicklist()
120 self.assertThat(self.unity.launcher.key_nav_is_grabbed, Eventually(Equals(True)))121 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(False)))
122 self.assertThat(self.unity.launcher.key_nav_is_active, Eventually(Equals(True)))
123 self.assertThat(self.unity.launcher.key_nav_is_grabbed, Eventually(Equals(True)))
121124
122 def test_launcher_keynav_mode_toggles(self):125 def test_launcher_keynav_mode_toggles(self):
123 """Tests that keynav mode toggles with Alt+F1."""126 """Tests that keynav mode toggles with Alt+F1."""
124127
=== modified file 'tests/test_launcher.cpp'
--- tests/test_launcher.cpp 2016-03-18 07:01:34 +0000
+++ tests/test_launcher.cpp 2016-03-18 07:01:34 +0000
@@ -62,6 +62,7 @@
62 MOCK_METHOD1(Stick, void(bool));62 MOCK_METHOD1(Stick, void(bool));
63 MOCK_METHOD2(PerformScroll, void(ScrollDirection, Time));63 MOCK_METHOD2(PerformScroll, void(ScrollDirection, Time));
64 MOCK_METHOD0(HideTooltip, void());64 MOCK_METHOD0(HideTooltip, void());
65 MOCK_METHOD0(PromptHideTooltip, void());
65 MOCK_METHOD3(SetQuirk, void(ApplicationLauncherIcon::Quirk, bool, int));66 MOCK_METHOD3(SetQuirk, void(ApplicationLauncherIcon::Quirk, bool, int));
66 MOCK_METHOD2(SetQuirk, void(ApplicationLauncherIcon::Quirk, bool));67 MOCK_METHOD2(SetQuirk, void(ApplicationLauncherIcon::Quirk, bool));
67 MOCK_METHOD2(SkipQuirkAnimation, void(ApplicationLauncherIcon::Quirk, int));68 MOCK_METHOD2(SkipQuirkAnimation, void(ApplicationLauncherIcon::Quirk, int));
6869
=== modified file 'unity-shared/DashStyle.cpp'
--- unity-shared/DashStyle.cpp 2016-03-10 10:09:12 +0000
+++ unity-shared/DashStyle.cpp 2016-03-18 07:01:34 +0000
@@ -2082,14 +2082,24 @@
2082 return true;2082 return true;
2083}2083}
20842084
2085BaseTexturePtr Style::GetDashBottomTile(double scale) const2085BaseTexturePtr Style::GetDashHorizontalTile(double scale, DashPosition dash_position) const
2086{2086{
2087 return pimpl->LoadScaledTexture("dash_bottom_border_tile.png", scale);2087 std::string horizontal_tile;
2088 if (dash_position == DashPosition::BOTTOM)
2089 horizontal_tile = "dash_top_border_tile.png";
2090 else
2091 horizontal_tile = "dash_bottom_border_tile.png";
2092 return pimpl->LoadScaledTexture(horizontal_tile, scale);
2088}2093}
20892094
2090BaseTexturePtr Style::GetDashBottomTileMask(double scale) const2095BaseTexturePtr Style::GetDashHorizontalTileMask(double scale, DashPosition dash_position) const
2091{2096{
2092 return pimpl->LoadScaledTexture("dash_bottom_border_tile_mask.png", scale);2097 std::string horizontal_tile_mask;
2098 if (dash_position == DashPosition::BOTTOM)
2099 horizontal_tile_mask = "dash_top_border_tile_mask.png";
2100 else
2101 horizontal_tile_mask = "dash_bottom_border_tile_mask.png";
2102 return pimpl->LoadScaledTexture(horizontal_tile_mask, scale);
2093}2103}
20942104
2095BaseTexturePtr Style::GetDashRightTile(double scale) const2105BaseTexturePtr Style::GetDashRightTile(double scale) const
@@ -2107,39 +2117,74 @@
2107 return pimpl->LoadScaledTexture("dash_left_tile.png", scale);2117 return pimpl->LoadScaledTexture("dash_left_tile.png", scale);
2108}2118}
21092119
2110BaseTexturePtr Style::GetDashTopTile(double scale) const2120BaseTexturePtr Style::GetDashTopOrBottomTile(double scale, DashPosition dash_position) const
2111{2121{
2112 return pimpl->LoadScaledTexture("dash_top_tile.png", scale);2122 std::string top_bottom_tile;
2113}2123 if (dash_position == DashPosition::BOTTOM)
21142124 top_bottom_tile = "dash_bottom_tile.png";
2115BaseTexturePtr Style::GetDashCorner(double scale) const2125 else
2116{2126 top_bottom_tile = "dash_top_tile.png";
2117 return pimpl->LoadScaledTexture("dash_bottom_right_corner.png", scale);2127 return pimpl->LoadScaledTexture(top_bottom_tile, scale);
2118}2128}
21192129
2120BaseTexturePtr Style::GetDashCornerMask(double scale) const2130BaseTexturePtr Style::GetDashCorner(double scale, DashPosition dash_position) const
2121{2131{
2122 return pimpl->LoadScaledTexture("dash_bottom_right_corner_mask.png", scale);2132 std::string corner;
2123}2133 if (dash_position == DashPosition::BOTTOM)
21242134 corner = "dash_top_right_corner_rotated.png";
2125BaseTexturePtr Style::GetDashLeftCorner(double scale) const2135 else
2126{2136 corner = "dash_bottom_right_corner.png";
2127 return pimpl->LoadScaledTexture("dash_bottom_left_corner.png", scale);2137 return pimpl->LoadScaledTexture(corner, scale);
2128}2138}
21292139
2130BaseTexturePtr Style::GetDashLeftCornerMask(double scale) const2140BaseTexturePtr Style::GetDashCornerMask(double scale, DashPosition dash_position) const
2131{2141{
2132 return pimpl->LoadScaledTexture("dash_bottom_left_corner_mask.png", scale);2142 std::string corner_mask;
2133}2143 if (dash_position == DashPosition::BOTTOM)
21342144 corner_mask = "dash_top_right_corner_rotated_mask.png";
2135BaseTexturePtr Style::GetDashTopCorner(double scale) const2145 else
2136{2146 corner_mask = "dash_bottom_right_corner_mask.png";
2137 return pimpl->LoadScaledTexture("dash_top_right_corner.png", scale);2147 return pimpl->LoadScaledTexture(corner_mask, scale);
2138}2148}
21392149
2140BaseTexturePtr Style::GetDashTopCornerMask(double scale) const2150BaseTexturePtr Style::GetDashLeftCorner(double scale, DashPosition dash_position) const
2141{2151{
2142 return pimpl->LoadScaledTexture("dash_top_right_corner_mask.png", scale);2152 std::string left_corner;
2153 if (dash_position == DashPosition::BOTTOM)
2154 left_corner = "dash_top_left_corner.png";
2155 else
2156 left_corner = "dash_bottom_left_corner.png";
2157 return pimpl->LoadScaledTexture(left_corner, scale);
2158}
2159
2160BaseTexturePtr Style::GetDashLeftCornerMask(double scale, DashPosition dash_position) const
2161{
2162 std::string left_corner_mask;
2163 if (dash_position == DashPosition::BOTTOM)
2164 left_corner_mask = "dash_top_left_corner_mask.png";
2165 else
2166 left_corner_mask = "dash_bottom_left_corner_mask.png";
2167 return pimpl->LoadScaledTexture(left_corner_mask, scale);
2168}
2169
2170BaseTexturePtr Style::GetDashRightCorner(double scale, DashPosition dash_position) const
2171{
2172 std::string right_corner;
2173 if (dash_position == DashPosition::BOTTOM)
2174 right_corner = "dash_bottom_right_corner_rotated.png";
2175 else
2176 right_corner = "dash_top_right_corner.png";
2177 return pimpl->LoadScaledTexture(right_corner, scale);
2178}
2179
2180BaseTexturePtr Style::GetDashRightCornerMask(double scale, DashPosition dash_position) const
2181{
2182 std::string right_corner_mask;
2183 if (dash_position == DashPosition::BOTTOM)
2184 right_corner_mask = "dash_bottom_right_corner_rotated_mask.png";
2185 else
2186 right_corner_mask = "dash_top_right_corner_mask.png";
2187 return pimpl->LoadScaledTexture(right_corner_mask, scale);
2143}2188}
21442189
2145BaseTexturePtr Style::GetSearchMagnifyIcon(double scale) const2190BaseTexturePtr Style::GetSearchMagnifyIcon(double scale) const
21462191
=== modified file 'unity-shared/DashStyle.h'
--- unity-shared/DashStyle.h 2016-03-10 10:09:12 +0000
+++ unity-shared/DashStyle.h 2016-03-18 07:01:34 +0000
@@ -85,6 +85,10 @@
85 NONE85 NONE
86};86};
8787
88enum class DashPosition {
89 LEFT,
90 BOTTOM
91};
8892
89class Style : public StyleInterface93class Style : public StyleInterface
90{94{
@@ -168,19 +172,19 @@
168 BaseTexturePtr const& GetCategoryBackground() const;172 BaseTexturePtr const& GetCategoryBackground() const;
169 BaseTexturePtr const& GetCategoryBackgroundNoFilters() const;173 BaseTexturePtr const& GetCategoryBackgroundNoFilters() const;
170174
171 BaseTexturePtr GetDashBottomTile(double scale) const;175 BaseTexturePtr GetDashHorizontalTile(double scale, DashPosition dash_position) const;
172 BaseTexturePtr GetDashBottomTileMask(double scale) const;176 BaseTexturePtr GetDashHorizontalTileMask(double scale, DashPosition dash_position) const;
173 BaseTexturePtr GetDashRightTile(double scale) const;177 BaseTexturePtr GetDashRightTile(double scale) const;
174 BaseTexturePtr GetDashRightTileMask(double scale) const;178 BaseTexturePtr GetDashRightTileMask(double scale) const;
175 BaseTexturePtr GetDashLeftTile(double scale) const;179 BaseTexturePtr GetDashLeftTile(double scale) const;
176 BaseTexturePtr GetDashTopTile(double scale) const;180 BaseTexturePtr GetDashTopOrBottomTile(double scale, DashPosition dash_position) const;
177181
178 BaseTexturePtr GetDashCorner(double scale) const;182 BaseTexturePtr GetDashCorner(double scale, DashPosition dash_position) const;
179 BaseTexturePtr GetDashCornerMask(double scale) const;183 BaseTexturePtr GetDashCornerMask(double scale, DashPosition dash_position) const;
180 BaseTexturePtr GetDashLeftCorner(double scale) const;184 BaseTexturePtr GetDashLeftCorner(double scale, DashPosition dash_position) const;
181 BaseTexturePtr GetDashLeftCornerMask(double scale) const;185 BaseTexturePtr GetDashLeftCornerMask(double scale, DashPosition dash_position) const;
182 BaseTexturePtr GetDashTopCorner(double scale) const;186 BaseTexturePtr GetDashRightCorner(double scale, DashPosition dash_position) const;
183 BaseTexturePtr GetDashTopCornerMask(double scale) const;187 BaseTexturePtr GetDashRightCornerMask(double scale, DashPosition dash_position) const;
184188
185 RawPixel GetDashHorizontalBorderHeight() const;189 RawPixel GetDashHorizontalBorderHeight() const;
186 RawPixel GetDashVerticalBorderWidth() const;190 RawPixel GetDashVerticalBorderWidth() const;
187191
=== modified file 'unity-shared/OverlayRenderer.cpp'
--- unity-shared/OverlayRenderer.cpp 2015-04-21 15:12:02 +0000
+++ unity-shared/OverlayRenderer.cpp 2016-03-18 07:01:34 +0000
@@ -26,7 +26,9 @@
2626
27#include "DashStyle.h"27#include "DashStyle.h"
28#include "unity-shared/BackgroundEffectHelper.h"28#include "unity-shared/BackgroundEffectHelper.h"
29#include "unity-shared/PanelStyle.h"
29#include "unity-shared/UnitySettings.h"30#include "unity-shared/UnitySettings.h"
31#include "unity-shared/UScreen.h"
30#include "unity-shared/WindowManager.h"32#include "unity-shared/WindowManager.h"
3133
3234
@@ -75,19 +77,19 @@
7577
76 std::unique_ptr<nux::TextureLayer> bg_refine_gradient_;78 std::unique_ptr<nux::TextureLayer> bg_refine_gradient_;
7779
78 nux::ObjectPtr<nux::BaseTexture> bottom_texture_;80 nux::ObjectPtr<nux::BaseTexture> horizontal_texture_;
79 nux::ObjectPtr<nux::BaseTexture> bottom_texture_mask_;81 nux::ObjectPtr<nux::BaseTexture> horizontal_texture_mask_;
80 nux::ObjectPtr<nux::BaseTexture> right_texture_;82 nux::ObjectPtr<nux::BaseTexture> right_texture_;
81 nux::ObjectPtr<nux::BaseTexture> right_texture_mask_;83 nux::ObjectPtr<nux::BaseTexture> right_texture_mask_;
82 nux::ObjectPtr<nux::BaseTexture> left_texture_;84 nux::ObjectPtr<nux::BaseTexture> left_texture_;
83 nux::ObjectPtr<nux::BaseTexture> top_texture_;85 nux::ObjectPtr<nux::BaseTexture> top_bottom_texture_;
8486
85 nux::ObjectPtr<nux::BaseTexture> corner_;87 nux::ObjectPtr<nux::BaseTexture> corner_;
86 nux::ObjectPtr<nux::BaseTexture> corner_mask_;88 nux::ObjectPtr<nux::BaseTexture> corner_mask_;
87 nux::ObjectPtr<nux::BaseTexture> left_corner_;89 nux::ObjectPtr<nux::BaseTexture> left_corner_;
88 nux::ObjectPtr<nux::BaseTexture> left_corner_mask_;90 nux::ObjectPtr<nux::BaseTexture> left_corner_mask_;
89 nux::ObjectPtr<nux::BaseTexture> top_corner_;91 nux::ObjectPtr<nux::BaseTexture> right_corner_;
90 nux::ObjectPtr<nux::BaseTexture> top_corner_mask_;92 nux::ObjectPtr<nux::BaseTexture> right_corner_mask_;
9193
92 // temporary variable that stores the number of backgrounds we have rendered94 // temporary variable that stores the number of backgrounds we have rendered
93 int bgs;95 int bgs;
@@ -116,7 +118,9 @@
116{118{
117 parent->scale = Settings::Instance().em()->DPIScale();119 parent->scale = Settings::Instance().em()->DPIScale();
118 parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));120 parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
121 parent->owner_type.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
119 Settings::Instance().low_gfx_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures));122 Settings::Instance().low_gfx_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures));
123 Settings::Instance().launcher_position.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
120124
121 UpdateTextures();125 UpdateTextures();
122 LoadScaledTextures();126 LoadScaledTextures();
@@ -126,19 +130,25 @@
126{130{
127 double scale = parent->scale;131 double scale = parent->scale;
128 auto& style = dash::Style::Instance();132 auto& style = dash::Style::Instance();
129 bottom_texture_ = style.GetDashBottomTile(scale);133 dash::DashPosition dash_position;
130 bottom_texture_mask_ = style.GetDashBottomTileMask(scale);134 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM && parent->owner_type() == OverlayOwner::Dash)
135 dash_position = dash::DashPosition::BOTTOM;
136 else
137 dash_position = dash::DashPosition::LEFT;
138
139 horizontal_texture_ = style.GetDashHorizontalTile(scale, dash_position);
140 horizontal_texture_mask_ = style.GetDashHorizontalTileMask(scale, dash_position);
131 right_texture_ = style.GetDashRightTile(scale);141 right_texture_ = style.GetDashRightTile(scale);
132 right_texture_mask_ = style.GetDashRightTileMask(scale);142 right_texture_mask_ = style.GetDashRightTileMask(scale);
133 left_texture_ = style.GetDashLeftTile(scale);143 left_texture_ = style.GetDashLeftTile(scale);
134 top_texture_ = style.GetDashTopTile(scale);144 top_bottom_texture_ = style.GetDashTopOrBottomTile(scale, dash_position);
135145
136 corner_ = style.GetDashCorner(scale);146 corner_ = style.GetDashCorner(scale, dash_position);
137 corner_mask_ = style.GetDashCornerMask(scale);147 corner_mask_ = style.GetDashCornerMask(scale, dash_position);
138 left_corner_ = style.GetDashLeftCorner(scale);148 left_corner_ = style.GetDashLeftCorner(scale, dash_position);
139 left_corner_mask_ = style.GetDashLeftCornerMask(scale);149 left_corner_mask_ = style.GetDashLeftCornerMask(scale, dash_position);
140 top_corner_ = style.GetDashTopCorner(scale);150 right_corner_ = style.GetDashRightCorner(scale, dash_position);
141 top_corner_mask_ = style.GetDashTopCornerMask(scale);151 right_corner_mask_ = style.GetDashRightCornerMask(scale, dash_position);
142}152}
143153
144void OverlayRendererImpl::OnBgColorChanged(nux::Color const& new_color)154void OverlayRendererImpl::OnBgColorChanged(nux::Color const& new_color)
@@ -598,7 +608,21 @@
598608
599 if (Settings::Instance().form_factor() != FormFactor::NETBOOK || force_edges)609 if (Settings::Instance().form_factor() != FormFactor::NETBOOK || force_edges)
600 {610 {
601 nux::Geometry geo_border(content_geo.x, content_geo.y, larger_absolute_geo.width - content_geo.x, larger_absolute_geo.height);611 int monitor = unity::UScreen::GetDefault()->GetMonitorWithMouse();
612 nux::Geometry const& monitor_geo = unity::UScreen::GetDefault()->GetMonitorGeometry(monitor);
613 int launcher_size = Settings::Instance().LauncherSize(monitor);
614 int panel_height = panel::Style::Instance().PanelHeight(monitor);
615
616 dash::DashPosition dash_position = dash::DashPosition::LEFT;
617 int border_y = content_geo.y;
618 int border_height = larger_absolute_geo.height;
619 if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM && !force_edges)
620 {
621 border_y = panel_height;
622 border_height = monitor_geo.height - launcher_size;
623 dash_position = dash::DashPosition::BOTTOM;
624 }
625 nux::Geometry geo_border(content_geo.x, border_y, larger_absolute_geo.width - content_geo.x, border_height);
602 gfx_context.PushClippingRectangle(geo_border);626 gfx_context.PushClippingRectangle(geo_border);
603627
604 // Paint the edges628 // Paint the edges
@@ -608,8 +632,8 @@
608 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);632 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
609633
610 nux::TexCoordXForm texxform;634 nux::TexCoordXForm texxform;
611 auto const& bottom = bottom_texture_;635 auto const& horizontal = horizontal_texture_;
612 auto const& bottom_mask = bottom_texture_mask_;636 auto const& horizontal_mask = horizontal_texture_mask_;
613 auto const& right = right_texture_;637 auto const& right = right_texture_;
614 auto const& right_mask = right_texture_mask_;638 auto const& right_mask = right_texture_mask_;
615 auto const& corner = corner_;639 auto const& corner = corner_;
@@ -617,14 +641,14 @@
617 auto const& left_corner = left_corner_;641 auto const& left_corner = left_corner_;
618 auto const& left_corner_mask = left_corner_mask_;642 auto const& left_corner_mask = left_corner_mask_;
619 auto const& left_tile = left_texture_;643 auto const& left_tile = left_texture_;
620 auto const& top_corner = top_corner_;644 auto const& right_corner = right_corner_;
621 auto const& top_corner_mask = top_corner_mask_;645 auto const& right_corner_mask = right_corner_mask_;
622 auto const& top_tile = top_texture_;646 auto const& top_tile = top_bottom_texture_;
623647
624 int left_corner_offset = LEFT_CORNER_OFFSET.CP(scale);648 int left_corner_offset = LEFT_CORNER_OFFSET.CP(scale);
625 int top_corner_offset = TOP_CORNER_OFFSET.CP(scale);649 int top_corner_offset = TOP_CORNER_OFFSET.CP(scale);
626 nux::Size corner_size(corner->GetWidth(), corner->GetHeight());650 nux::Size corner_size(corner->GetWidth(), corner->GetHeight());
627 nux::Size top_corner_size(top_corner->GetWidth(), top_corner->GetHeight());651 nux::Size right_corner_size(right_corner->GetWidth(), right_corner->GetHeight());
628 nux::Size left_corner_size(left_corner->GetWidth(), left_corner->GetHeight());652 nux::Size left_corner_size(left_corner->GetWidth(), left_corner->GetHeight());
629653
630 geo.width += corner_size.width - left_corner_offset;654 geo.width += corner_size.width - left_corner_offset;
@@ -633,10 +657,15 @@
633 // Corner657 // Corner
634 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);658 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
635 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);659 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
660 int corner_y = 0;
661 if (dash_position == dash::DashPosition::BOTTOM)
662 corner_y = geo.y - corner_size.height + top_corner_offset;
663 else
664 corner_y = geo.y + (geo.height - corner_size.height);
636665
637 // Selectively erase blur region in the curbe666 // Selectively erase blur region in the curbe
638 gfx_context.QRP_ColorModTexAlpha(geo.x + (geo.width - corner_size.width),667 gfx_context.QRP_ColorModTexAlpha(geo.x + (geo.width - corner_size.width),
639 geo.y + (geo.height - corner_size.height),668 corner_y,
640 corner_size.width,669 corner_size.width,
641 corner_size.height,670 corner_size.height,
642 corner_mask->GetDeviceTexture(),671 corner_mask->GetDeviceTexture(),
@@ -647,7 +676,7 @@
647 gfx_context.GetRenderStates().SetBlend(false);676 gfx_context.GetRenderStates().SetBlend(false);
648 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);677 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
649 RenderInverseMask(gfx_context, geo.x + (geo.width - corner_size.width),678 RenderInverseMask(gfx_context, geo.x + (geo.width - corner_size.width),
650 geo.y + (geo.height - corner_size.height),679 corner_y,
651 corner_size.width,680 corner_size.width,
652 corner_size.height,681 corner_size.height,
653 corner_mask->GetDeviceTexture(),682 corner_mask->GetDeviceTexture(),
@@ -659,7 +688,7 @@
659 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);688 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
660689
661 gfx_context.QRP_1Tex(geo.x + (geo.width - corner_size.width),690 gfx_context.QRP_1Tex(geo.x + (geo.width - corner_size.width),
662 geo.y + (geo.height - corner_size.height),691 corner_y,
663 corner_size.width,692 corner_size.width,
664 corner_size.height,693 corner_size.height,
665 corner->GetDeviceTexture(),694 corner->GetDeviceTexture(),
@@ -667,19 +696,24 @@
667 nux::color::White);696 nux::color::White);
668 }697 }
669 {698 {
670 // Bottom repeated texture699 // Horizontal repeated texture
671 int real_width = geo.width - (left_corner_size.width - left_corner_offset) - corner_size.width;700 int real_width = geo.width - (left_corner_size.width - left_corner_offset) - corner_size.width;
672 int offset = real_width % bottom->GetWidth();701 int offset = real_width % horizontal->GetWidth();
702 int horizontal_y = 0;
703 if (dash_position == dash::DashPosition::BOTTOM)
704 horizontal_y = geo.y - horizontal->GetHeight() + top_corner_offset;
705 else
706 horizontal_y = geo.y + (geo.height - horizontal->GetHeight());
673707
674 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);708 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
675 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);709 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
676710
677 // Selectively erase blur region in the curbe711 // Selectively erase blur region in the curbe
678 gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset - offset,712 gfx_context.QRP_ColorModTexAlpha(left_corner_size.width - left_corner_offset - offset,
679 geo.y + (geo.height - bottom->GetHeight()),713 horizontal_y,
680 real_width + offset,714 real_width + offset,
681 bottom->GetHeight(),715 horizontal->GetHeight(),
682 bottom_mask->GetDeviceTexture(),716 horizontal_mask->GetDeviceTexture(),
683 texxform,717 texxform,
684 nux::color::Black);718 nux::color::Black);
685719
@@ -687,10 +721,10 @@
687 gfx_context.GetRenderStates().SetBlend(false);721 gfx_context.GetRenderStates().SetBlend(false);
688 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);722 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
689 RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset - offset,723 RenderInverseMask(gfx_context, left_corner_size.width - left_corner_offset - offset,
690 geo.y + (geo.height - bottom->GetHeight()),724 horizontal_y,
691 real_width + offset,725 real_width + offset,
692 bottom->GetHeight(),726 horizontal->GetHeight(),
693 bottom_mask->GetDeviceTexture(),727 horizontal_mask->GetDeviceTexture(),
694 texxform,728 texxform,
695 nux::color::White);729 nux::color::White);
696730
@@ -699,44 +733,52 @@
699 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);733 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
700734
701 gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset - offset,735 gfx_context.QRP_1Tex(left_corner_size.width - left_corner_offset - offset,
702 geo.y + (geo.height - bottom->GetHeight()),736 horizontal_y,
703 real_width + offset,737 real_width + offset,
704 bottom->GetHeight(),738 horizontal->GetHeight(),
705 bottom->GetDeviceTexture(),739 horizontal->GetDeviceTexture(),
706 texxform,740 texxform,
707 nux::color::White);741 nux::color::White);
708 }742 }
709 {743 {
710 // Bottom left corner744 // Bottom left or top left corner
711 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);745 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
712 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);746 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
713747 int left_corner_y = 0;
714 // Selectively erase blur region in the curbe748 if (dash_position == dash::DashPosition::BOTTOM)
715 gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset,749 left_corner_y = geo.y - left_corner_size.height + top_corner_offset;
716 geo.y + (geo.height - left_corner_size.height),750 else
717 left_corner_size.width,751 left_corner_y = geo.y + (geo.height - left_corner_size.height);
718 left_corner_size.height,752
719 left_corner_mask->GetDeviceTexture(),753 if (dash_position == dash::DashPosition::LEFT)
720 texxform,754 {
721 nux::color::Black);755 // Selectively erase blur region in the curbe
722756 gfx_context.QRP_ColorModTexAlpha(geo.x - left_corner_offset,
723 // Write correct alpha757 left_corner_y,
724 gfx_context.GetRenderStates().SetBlend(false);758 left_corner_size.width,
725 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);759 left_corner_size.height,
726 RenderInverseMask(gfx_context, geo.x - left_corner_offset,760 left_corner_mask->GetDeviceTexture(),
727 geo.y + (geo.height - left_corner_size.height),761 texxform,
728 left_corner_size.width,762 nux::color::Black);
729 left_corner_size.height,763
730 left_corner_mask->GetDeviceTexture(),764 // Write correct alpha
731 texxform,765 gfx_context.GetRenderStates().SetBlend(false);
732 nux::color::White);766 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
767 RenderInverseMask(gfx_context, geo.x - left_corner_offset,
768 left_corner_y,
769 left_corner_size.width,
770 left_corner_size.height,
771 left_corner_mask->GetDeviceTexture(),
772 texxform,
773 nux::color::White);
774 }
733775
734 gfx_context.GetRenderStates().SetBlend(true);776 gfx_context.GetRenderStates().SetBlend(true);
735 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);777 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
736 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);778 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
737779
738 gfx_context.QRP_1Tex(geo.x - left_corner_offset,780 gfx_context.QRP_1Tex(geo.x - left_corner_offset,
739 geo.y + (geo.height - left_corner_size.height),781 left_corner_y,
740 left_corner_size.width,782 left_corner_size.width,
741 left_corner_size.height,783 left_corner_size.height,
742 left_corner->GetDeviceTexture(),784 left_corner->GetDeviceTexture(),
@@ -748,12 +790,27 @@
748 nux::Geometry real_geo = geometry;790 nux::Geometry real_geo = geometry;
749 int real_height = real_geo.height - geo.height;791 int real_height = real_geo.height - geo.height;
750 int offset = real_height % left_tile->GetHeight();792 int offset = real_height % left_tile->GetHeight();
793 int left_texture_y = 0;
794 if (dash_position == dash::DashPosition::BOTTOM)
795 {
796 left_texture_y = panel_height;
797 real_height = monitor_geo.height - launcher_size - content_geo.height - left_corner->GetHeight() - panel_height + top_corner_offset;
798 }
799 else if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
800 {
801 left_texture_y = geo.y + geo.height;
802 real_height -= launcher_size;
803 }
804 else
805 {
806 left_texture_y = geo.y + geo.height;
807 }
751808
752 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);809 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
753 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);810 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
754811
755 gfx_context.QRP_1Tex(geo.x - left_corner_offset,812 gfx_context.QRP_1Tex(geo.x - left_corner_offset,
756 geo.y + geo.height,813 left_texture_y,
757 left_tile->GetWidth(),814 left_tile->GetWidth(),
758 real_height + offset,815 real_height + offset,
759 left_tile->GetDeviceTexture(),816 left_tile->GetDeviceTexture(),
@@ -764,12 +821,17 @@
764 // Right edge821 // Right edge
765 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);822 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
766 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);823 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
824 int right_edge_y = 0;
825 if (dash_position == dash::DashPosition::BOTTOM)
826 right_edge_y = geo.y + top_corner_offset;
827 else
828 right_edge_y = geo.y + right_corner_size.height - top_corner_offset;
767829
768 // Selectively erase blur region in the curbe830 // Selectively erase blur region in the curbe
769 gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(),831 gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(),
770 geo.y + top_corner_size.height - top_corner_offset,832 right_edge_y,
771 right->GetWidth(),833 right->GetWidth(),
772 geo.height - corner_size.height - (top_corner_size.height - top_corner_offset),834 geo.height - corner_size.height - (right_corner_size.height - top_corner_offset),
773 right_mask->GetDeviceTexture(),835 right_mask->GetDeviceTexture(),
774 texxform,836 texxform,
775 nux::color::Black);837 nux::color::Black);
@@ -778,9 +840,9 @@
778 gfx_context.GetRenderStates().SetBlend(false);840 gfx_context.GetRenderStates().SetBlend(false);
779 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);841 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
780 RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(),842 RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(),
781 geo.y + top_corner_size.height - top_corner_offset,843 right_edge_y,
782 right->GetWidth(),844 right->GetWidth(),
783 geo.height - corner_size.height - (top_corner_size.height - top_corner_offset),845 geo.height - corner_size.height - (right_corner_size.height - top_corner_offset),
784 right_mask->GetDeviceTexture(),846 right_mask->GetDeviceTexture(),
785 texxform,847 texxform,
786 nux::color::White);848 nux::color::White);
@@ -790,24 +852,29 @@
790 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);852 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
791853
792 gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(),854 gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(),
793 geo.y + top_corner_size.height - top_corner_offset,855 right_edge_y,
794 right->GetWidth(),856 right->GetWidth(),
795 geo.height - corner_size.height - (top_corner_size.height - top_corner_offset),857 geo.height - corner_size.height - (right_corner_size.height - top_corner_offset),
796 right->GetDeviceTexture(),858 right->GetDeviceTexture(),
797 texxform,859 texxform,
798 nux::color::White);860 nux::color::White);
799 }861 }
800 {862 {
801 // Top right corner863 // Top right or bottom right corner
802 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);864 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
803 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);865 texxform.SetWrap(nux::TEXWRAP_CLAMP_TO_BORDER, nux::TEXWRAP_CLAMP_TO_BORDER);
866 int right_corner_y = 0;
867 if (dash_position == dash::DashPosition::BOTTOM)
868 right_corner_y = geo.y + content_geo.height - right_corner_size.height + top_corner_offset;
869 else
870 right_corner_y = geo.y - top_corner_offset;
804871
805 // Selectively erase blur region in the curbe872 // Selectively erase blur region in the curbe
806 gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(),873 gfx_context.QRP_ColorModTexAlpha(geo.x + geo.width - right->GetWidth(),
807 geo.y - top_corner_offset,874 right_corner_y,
808 top_corner_size.width,875 right_corner_size.width,
809 top_corner_size.height,876 right_corner_size.height,
810 top_corner_mask->GetDeviceTexture(),877 right_corner_mask->GetDeviceTexture(),
811 texxform,878 texxform,
812 nux::color::Black);879 nux::color::Black);
813880
@@ -815,10 +882,10 @@
815 gfx_context.GetRenderStates().SetBlend(false);882 gfx_context.GetRenderStates().SetBlend(false);
816 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);883 gfx_context.GetRenderStates().SetColorMask(false, false, false, true);
817 RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(),884 RenderInverseMask(gfx_context, geo.x + geo.width - right->GetWidth(),
818 geo.y - top_corner_offset,885 right_corner_y,
819 top_corner_size.width,886 right_corner_size.width,
820 top_corner_size.height,887 right_corner_size.height,
821 top_corner_mask->GetDeviceTexture(),888 right_corner_mask->GetDeviceTexture(),
822 texxform,889 texxform,
823 nux::color::White);890 nux::color::White);
824891
@@ -826,21 +893,26 @@
826 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);893 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
827 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);894 gfx_context.GetRenderStates().SetColorMask(true, true, true, true);
828 gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(),895 gfx_context.QRP_1Tex(geo.x + geo.width - right->GetWidth(),
829 geo.y - top_corner_offset,896 right_corner_y,
830 top_corner_size.width,897 right_corner_size.width,
831 top_corner_size.height,898 right_corner_size.height,
832 top_corner->GetDeviceTexture(),899 right_corner->GetDeviceTexture(),
833 texxform,900 texxform,
834 nux::color::White);901 nux::color::White);
835 }902 }
836 {903 {
837 // Top edge904 // Top or bottom edge
838 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);905 texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
839 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);906 texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
907 int y = 0;
908 if (dash_position == dash::DashPosition::BOTTOM)
909 y = geo.y + content_geo.height - top_tile->GetHeight() + top_corner_offset;
910 else
911 y = geo.y - top_corner_offset;
840912
841 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);913 gfx_context.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
842 gfx_context.QRP_1Tex(geo.x + geo.width,914 gfx_context.QRP_1Tex(geo.x + geo.width,
843 geo.y - top_corner_offset,915 y,
844 geometry.width - (geo.x + geo.width),916 geometry.width - (geo.x + geo.width),
845 top_tile->GetHeight(),917 top_tile->GetHeight(),
846 top_tile->GetDeviceTexture(),918 top_tile->GetDeviceTexture(),
847919
=== modified file 'unity-shared/OverlayRenderer.h'
--- unity-shared/OverlayRenderer.h 2014-07-08 13:46:29 +0000
+++ unity-shared/OverlayRenderer.h 2016-03-18 07:01:34 +0000
@@ -29,6 +29,12 @@
29namespace unity 29namespace unity
30{30{
3131
32enum class OverlayOwner
33{
34 Dash = 0,
35 Hud
36};
37
32class OverlayRendererImpl;38class OverlayRendererImpl;
33class OverlayRenderer39class OverlayRenderer
34{40{
@@ -40,6 +46,7 @@
40 nux::Property<int> x_offset;46 nux::Property<int> x_offset;
41 nux::Property<int> y_offset;47 nux::Property<int> y_offset;
42 nux::Property<double> scale;48 nux::Property<double> scale;
49 nux::Property<OverlayOwner> owner_type;
43 50
44 OverlayRenderer();51 OverlayRenderer();
45 ~OverlayRenderer();52 ~OverlayRenderer();
4653
=== modified file 'unity-shared/UBusMessages.h'
--- unity-shared/UBusMessages.h 2015-04-15 15:45:22 +0000
+++ unity-shared/UBusMessages.h 2016-03-18 07:01:34 +0000
@@ -41,6 +41,9 @@
41// get rid of keyboard-input-focus41// get rid of keyboard-input-focus
42#define UBUS_LAUNCHER_START_KEY_NAV "LAUNCHER_START_KEY_NAV"42#define UBUS_LAUNCHER_START_KEY_NAV "LAUNCHER_START_KEY_NAV"
43#define UBUS_LAUNCHER_END_KEY_NAV "LAUNCHER_END_KEY_NAV"43#define UBUS_LAUNCHER_END_KEY_NAV "LAUNCHER_END_KEY_NAV"
44#define UBUS_LAUNCHER_PREV_KEY_NAV "LAUNCHER_PREV_KEY_NAV"
45#define UBUS_LAUNCHER_NEXT_KEY_NAV "LAUNCHER_NEXT_KEY_NAV"
46#define UBUS_LAUNCHER_OPEN_QUICKLIST "LAUNCHER_OPEN_QUICKLIST"
44#define UBUS_LAUNCHER_START_KEY_SWITCHER "LAUNCHER_START_KEY_SWITCHER"47#define UBUS_LAUNCHER_START_KEY_SWITCHER "LAUNCHER_START_KEY_SWITCHER"
45#define UBUS_LAUNCHER_END_KEY_SWITCHER "LAUNCHER_END_KEY_SWITCHER"48#define UBUS_LAUNCHER_END_KEY_SWITCHER "LAUNCHER_END_KEY_SWITCHER"
46#define UBUS_LAUNCHER_SELECTION_CHANGED "LAUNCHER_ICON_SELECTION_CHANGED"49#define UBUS_LAUNCHER_SELECTION_CHANGED "LAUNCHER_ICON_SELECTION_CHANGED"