Merge lp:~azzar1/unity/fix-849561 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 1761
Proposed branch: lp:~azzar1/unity/fix-849561
Merge into: lp:unity
Diff against target: 88 lines (+23/-6)
3 files modified
manual-tests/HighlightedBFB.txt (+12/-0)
plugins/unityshell/src/BFBLauncherIcon.cpp (+1/-1)
plugins/unityshell/src/IconRenderer.cpp (+10/-5)
To merge this branch: bzr merge lp:~azzar1/unity/fix-849561
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
John Lea (community) design review Approve
Marco Trevisan (Treviño) Approve
Review via email: mp+83056@code.launchpad.net

Description of the change

Highlights bfb launcher icon during key navigation.

To test:
* press ALT+F1
* the launcher icon should be like this (https://bugs.launchpad.net/unity/+bug/849561/+attachment/2605217/+files/bfb85.png)

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

The code looks fine.

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

Andrea, can I get you to add a manual test for this?

Due to the visual nature of the change, we aren't going to have an automated test for this, but recording the expected behaviour in a manual test would be good.

review: Needs Fixing
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Done.

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

It's fine now.

review: Approve
Revision history for this message
Andrea Azzarone (azzar1) wrote :
Revision history for this message
John Lea (johnlea) wrote :

Reviewed and signed off by design, thx!

Let's also discuss this bug in Budapest, there are a couple of asset changes that we might want to play with, but this is easier to do when we are sitting face to face.

review: Approve (design review)
Revision history for this message
Tim Penhey (thumper) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'manual-tests/HighlightedBFB.txt'
2--- manual-tests/HighlightedBFB.txt 1970-01-01 00:00:00 +0000
3+++ manual-tests/HighlightedBFB.txt 2011-11-30 01:27:24 +0000
4@@ -0,0 +1,12 @@
5+Test highlight BFB
6+=====================
7+
8+This test shows that the BFB launcher icon highlights during key navigation.
9+
10+#. Start with a clear screen
11+#. Press ALT+F1
12+
13+Outcome
14+ The launcher key navigation starts and the BFB launcher icon highlights.
15+ It looks like `this`__:
16+ __https://launchpadlibrarian.net/85700200/bfb85.png
17
18=== added file 'plugins/unityshell/resources/squircle_base_selected_54.png'
19Binary files plugins/unityshell/resources/squircle_base_selected_54.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/squircle_base_selected_54.png 2011-11-30 01:27:24 +0000 differ
20=== added file 'plugins/unityshell/resources/squircle_glow_54.png'
21Binary files plugins/unityshell/resources/squircle_glow_54.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/squircle_glow_54.png 2011-11-30 01:27:24 +0000 differ
22=== modified file 'plugins/unityshell/src/BFBLauncherIcon.cpp'
23--- plugins/unityshell/src/BFBLauncherIcon.cpp 2011-10-06 04:18:36 +0000
24+++ plugins/unityshell/src/BFBLauncherIcon.cpp 2011-11-30 01:27:24 +0000
25@@ -38,7 +38,7 @@
26 SetQuirk(QUIRK_RUNNING, false);
27 SetIconType(TYPE_HOME);
28
29- _background_color = nux::Color (0xFF333333);
30+ _background_color = nux::color::White;
31
32 mouse_enter.connect([&] () { _ubus_manager.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); });
33 }
34
35=== modified file 'plugins/unityshell/src/IconRenderer.cpp'
36--- plugins/unityshell/src/IconRenderer.cpp 2011-10-26 21:48:41 +0000
37+++ plugins/unityshell/src/IconRenderer.cpp 2011-11-30 01:27:24 +0000
38@@ -180,6 +180,8 @@
39 nux::BaseTexture* arrow_empty_rtl = 0;
40
41 nux::BaseTexture* squircle_base = 0;
42+nux::BaseTexture* squircle_base_selected = 0;
43+nux::BaseTexture* squircle_glow = 0;
44 nux::BaseTexture* squircle_shine = 0;
45
46 std::vector<nux::BaseTexture*> icon_background;
47@@ -386,6 +388,7 @@
48 float glow_intensity = arg.glow_intensity;
49
50 nux::BaseTexture* background = local::icon_background[size];
51+ nux::BaseTexture* glow = local::icon_glow[size];
52 nux::BaseTexture* shine = local::icon_shine[size];
53
54 if (arg.keyboard_nav_hl)
55@@ -401,11 +404,11 @@
56
57 if (arg.system_item)
58 {
59- background_color = nux::color::White;
60- backlight_intensity = 1.0f;
61- glow_intensity = 0.0f;
62+ backlight_intensity = (arg.keyboard_nav_hl) ? 0.85f : 1.0f ;
63+ glow_intensity = (arg.keyboard_nav_hl) ? 1.0f : 0.0f ;
64
65- background = local::squircle_base;
66+ background = (arg.keyboard_nav_hl) ? local::squircle_base_selected : local::squircle_base;
67+ glow = local::squircle_glow;
68 shine = local::squircle_shine;
69 }
70
71@@ -456,7 +459,7 @@
72 {
73 RenderElement(GfxContext,
74 arg,
75- local::icon_glow[size]->GetDeviceTexture(),
76+ glow->GetDeviceTexture(),
77 glow_color,
78 glow_intensity * arg.alpha,
79 arg.icon->GetTransform(launcher::AbstractLauncherIcon::TRANSFORM_GLOW));
80@@ -1092,6 +1095,8 @@
81 PKGDATADIR"/launcher_icon_shine_54.png");
82
83 squircle_base = load_texture(PKGDATADIR"/squircle_base_54.png");
84+ squircle_base_selected = load_texture(PKGDATADIR"/squircle_base_selected_54.png");
85+ squircle_glow = load_texture(PKGDATADIR"/squircle_glow_54.png");
86 squircle_shine = load_texture(PKGDATADIR"/squircle_shine_54.png");
87
88 pip_ltr = load_texture(PKGDATADIR"/launcher_pip_ltr.png");