Merge lp:~unity-team/unity/launcher-icons-tweaks into lp:unity

Proposed by Andrea Cimitan
Status: Merged
Approved by: Andrea Cimitan
Approved revision: no longer in the source branch.
Merged at revision: 1965
Proposed branch: lp:~unity-team/unity/launcher-icons-tweaks
Merge into: lp:unity
Diff against target: 267 lines (+71/-51)
6 files modified
plugins/unityshell/src/DesktopLauncherIcon.cpp (+0/-12)
plugins/unityshell/src/DesktopLauncherIcon.h (+0/-3)
plugins/unityshell/src/DeviceLauncherIcon.cpp (+0/-10)
plugins/unityshell/src/DeviceLauncherIcon.h (+0/-2)
plugins/unityshell/src/IconRenderer.cpp (+67/-22)
plugins/unityshell/src/Launcher.cpp (+4/-2)
To merge this branch: bzr merge lp:~unity-team/unity/launcher-icons-tweaks
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Andrea Cimitan (community) Approve
Review via email: mp+92505@code.launchpad.net

Description of the change

- Added shadows on launcher icons and alt-tab icons
- Tweaked BFB edges
- Tweaked background tile color for wallpaper-colorized launcher icons (including BFB)
- Added device and show-desktop launcher icons to the list of wallpaper-colorized launcher icons

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

Code looks good, UI results rock! :)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

Attempt to merge into lp:unity failed due to conflicts:

text conflict in plugins/unityshell/src/Launcher.cpp

Revision history for this message
Andrea Cimitan (cimi) wrote :

Fixed conflict

Revision history for this message
Unity Merger (unity-merger) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Andrea Cimitan (cimi) :
review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'plugins/unityshell/resources/launcher_icon_shadow_200.png'
2Binary files plugins/unityshell/resources/launcher_icon_shadow_200.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/launcher_icon_shadow_200.png 2012-02-13 22:48:18 +0000 differ
3=== added file 'plugins/unityshell/resources/launcher_icon_shadow_62.png'
4Binary files plugins/unityshell/resources/launcher_icon_shadow_62.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/launcher_icon_shadow_62.png 2012-02-13 22:48:18 +0000 differ
5=== modified file 'plugins/unityshell/resources/squircle_base_54.png'
6Binary files plugins/unityshell/resources/squircle_base_54.png 2012-02-09 23:35:32 +0000 and plugins/unityshell/resources/squircle_base_54.png 2012-02-13 22:48:18 +0000 differ
7=== modified file 'plugins/unityshell/resources/squircle_base_selected_54.png'
8Binary files plugins/unityshell/resources/squircle_base_selected_54.png 2011-11-22 17:47:59 +0000 and plugins/unityshell/resources/squircle_base_selected_54.png 2012-02-13 22:48:18 +0000 differ
9=== added file 'plugins/unityshell/resources/squircle_edge_54.png'
10Binary files plugins/unityshell/resources/squircle_edge_54.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/squircle_edge_54.png 2012-02-13 22:48:18 +0000 differ
11=== removed file 'plugins/unityshell/resources/squircle_glow_54.png'
12Binary files plugins/unityshell/resources/squircle_glow_54.png 2012-02-10 01:59:34 +0000 and plugins/unityshell/resources/squircle_glow_54.png 1970-01-01 00:00:00 +0000 differ
13=== added file 'plugins/unityshell/resources/squircle_glow_62.png'
14Binary files plugins/unityshell/resources/squircle_glow_62.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/squircle_glow_62.png 2012-02-13 22:48:18 +0000 differ
15=== added file 'plugins/unityshell/resources/squircle_shadow_62.png'
16Binary files plugins/unityshell/resources/squircle_shadow_62.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/squircle_shadow_62.png 2012-02-13 22:48:18 +0000 differ
17=== modified file 'plugins/unityshell/src/DesktopLauncherIcon.cpp'
18--- plugins/unityshell/src/DesktopLauncherIcon.cpp 2012-02-12 10:53:47 +0000
19+++ plugins/unityshell/src/DesktopLauncherIcon.cpp 2012-02-13 22:48:18 +0000
20@@ -43,18 +43,6 @@
21 {
22 }
23
24-nux::Color
25-DesktopLauncherIcon::BackgroundColor()
26-{
27- return nux::Color(0xFF333333);
28-}
29-
30-nux::Color
31-DesktopLauncherIcon::GlowColor()
32-{
33- return nux::Color(0xFF333333);
34-}
35-
36 void
37 DesktopLauncherIcon::ActivateLauncherIcon(ActionArg arg)
38 {
39
40=== modified file 'plugins/unityshell/src/DesktopLauncherIcon.h'
41--- plugins/unityshell/src/DesktopLauncherIcon.h 2012-02-08 00:32:46 +0000
42+++ plugins/unityshell/src/DesktopLauncherIcon.h 2012-02-13 22:48:18 +0000
43@@ -34,9 +34,6 @@
44 DesktopLauncherIcon();
45 ~DesktopLauncherIcon();
46
47- virtual nux::Color BackgroundColor();
48- virtual nux::Color GlowColor();
49-
50 void SetShowInSwitcher(bool show_in_switcher)
51 {
52 show_in_switcher_ = show_in_switcher;
53
54=== modified file 'plugins/unityshell/src/DeviceLauncherIcon.cpp'
55--- plugins/unityshell/src/DeviceLauncherIcon.cpp 2012-02-08 00:32:46 +0000
56+++ plugins/unityshell/src/DeviceLauncherIcon.cpp 2012-02-13 22:48:18 +0000
57@@ -81,16 +81,6 @@
58 return g_volume_can_eject(volume_);
59 }
60
61-nux::Color DeviceLauncherIcon::BackgroundColor()
62-{
63- return nux::Color(0xFF333333);
64-}
65-
66-nux::Color DeviceLauncherIcon::GlowColor()
67-{
68- return nux::Color(0xFF333333);
69-}
70-
71 std::list<DbusmenuMenuitem*> DeviceLauncherIcon::GetMenus()
72 {
73 std::list<DbusmenuMenuitem*> result;
74
75=== modified file 'plugins/unityshell/src/DeviceLauncherIcon.h'
76--- plugins/unityshell/src/DeviceLauncherIcon.h 2012-02-08 00:32:46 +0000
77+++ plugins/unityshell/src/DeviceLauncherIcon.h 2012-02-13 22:48:18 +0000
78@@ -38,8 +38,6 @@
79 public:
80 DeviceLauncherIcon(GVolume* volume);
81
82- virtual nux::Color BackgroundColor();
83- virtual nux::Color GlowColor();
84 void UpdateVisibility(int visibility = -1);
85 void OnRemoved();
86 bool CanEject();
87
88=== modified file 'plugins/unityshell/src/IconRenderer.cpp'
89--- plugins/unityshell/src/IconRenderer.cpp 2012-02-10 01:39:46 +0000
90+++ plugins/unityshell/src/IconRenderer.cpp 2012-02-13 22:48:18 +0000
91@@ -191,13 +191,16 @@
92
93 nux::BaseTexture* squircle_base = 0;
94 nux::BaseTexture* squircle_base_selected = 0;
95+nux::BaseTexture* squircle_edge = 0;
96 nux::BaseTexture* squircle_glow = 0;
97+nux::BaseTexture* squircle_shadow = 0;
98 nux::BaseTexture* squircle_shine = 0;
99
100 std::vector<nux::BaseTexture*> icon_background;
101 std::vector<nux::BaseTexture*> icon_selected_background;
102 std::vector<nux::BaseTexture*> icon_edge;
103 std::vector<nux::BaseTexture*> icon_glow;
104+std::vector<nux::BaseTexture*> icon_shadow;
105 std::vector<nux::BaseTexture*> icon_shine;
106 nux::ObjectPtr<nux::IOpenGLBaseTexture> offscreen_progress_texture;
107 nux::ObjectPtr<nux::IOpenGLShaderProgram> shader_program_uv_persp_correction;
108@@ -398,10 +401,13 @@
109 nux::Color background_tile_colorify = arg.colorify;
110 float backlight_intensity = arg.backlight_intensity;
111 float glow_intensity = arg.glow_intensity;
112+ float shadow_intensity = 0.6f;
113
114 nux::BaseTexture* background = local::icon_background[size];
115+ nux::BaseTexture* edge = local::icon_edge[size];
116 nux::BaseTexture* glow = local::icon_glow[size];
117 nux::BaseTexture* shine = local::icon_shine[size];
118+ nux::BaseTexture* shadow = local::icon_shadow[size];
119
120 bool force_filter = icon_size != background->GetWidth();
121
122@@ -412,33 +418,58 @@
123 edge_color = nux::color::White;
124 colorify = nux::color::White;
125 background_tile_colorify = nux::color::White;
126- backlight_intensity = 0.95;
127+ backlight_intensity = 0.95f;
128 glow_intensity = 1.0f;
129+ shadow_intensity = 0.0f;
130
131 background = local::icon_selected_background[size];
132 }
133+ else
134+ {
135+ colorify.red += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.red);
136+ colorify.blue += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.blue);
137+ colorify.green += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.green);
138
139- colorify.red += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.red);
140- colorify.blue += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.blue);
141- colorify.green += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.green);
142- background_tile_colorify.red += (0.5f + 0.5f * arg.saturation) * (1.0f - background_tile_colorify.red);
143- background_tile_colorify.green += (0.5f + 0.5f * arg.saturation) * (1.0f - background_tile_colorify.green);
144- background_tile_colorify.blue += (0.5f + 0.5f * arg.saturation) * (1.0f - background_tile_colorify.blue);
145+ if (arg.colorify_background)
146+ {
147+ background_tile_colorify = background_tile_colorify * 0.7f;
148+ }
149+ else
150+ {
151+ background_tile_colorify.red += (0.5f + 0.5f * arg.saturation) * (1.0f - background_tile_colorify.red);
152+ background_tile_colorify.green += (0.5f + 0.5f * arg.saturation) * (1.0f - background_tile_colorify.green);
153+ background_tile_colorify.blue += (0.5f + 0.5f * arg.saturation) * (1.0f - background_tile_colorify.blue);
154+ }
155+ }
156
157 if (arg.system_item)
158 {
159- backlight_intensity = (arg.keyboard_nav_hl) ? 0.95f : 0.8f ;
160+ // 0.9f is BACKLIGHT_STRENGTH in Launcher.cpp
161+ backlight_intensity = (arg.keyboard_nav_hl) ? 0.95f : 0.9f;
162 glow_intensity = (arg.keyboard_nav_hl) ? 1.0f : 0.0f ;
163
164 background = local::squircle_base_selected;
165+ edge = local::squircle_edge;
166 glow = local::squircle_glow;
167 shine = local::squircle_shine;
168+ shadow = local::squircle_shadow;
169 }
170
171- if (arg.colorify_background && !arg.keyboard_nav_hl)
172+ // draw shadow
173+ if (shadow_intensity > 0)
174 {
175- background_tile_colorify = arg.colorify;
176- background_tile_colorify = background_tile_colorify * 0.65f;
177+ nux::Color shadow_color = background_tile_colorify * 0.3f;
178+
179+ // FIXME it is using the same transformation of the glow,
180+ // should have its own transformation.
181+ RenderElement(GfxContext,
182+ arg,
183+ shadow->GetDeviceTexture(),
184+ nux::color::White,
185+ shadow_color,
186+ shadow_intensity * arg.alpha,
187+ force_filter,
188+ arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_GLOW, monitor));
189 }
190
191 auto tile_transform = arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_TILE, monitor);
192@@ -456,19 +487,28 @@
193 tile_transform);
194 }
195
196- edge_color = edge_color + ((background_tile_color - edge_color) * arg.backlight_intensity);
197+ edge_color = edge_color + ((background_tile_color - edge_color) * backlight_intensity);
198+ nux::Color edge_tile_colorify = background_tile_colorify;
199
200- if (!arg.system_item)
201+ if (arg.colorify_background && !arg.keyboard_nav_hl)
202 {
203- RenderElement(GfxContext,
204- arg,
205- local::icon_edge[size]->GetDeviceTexture(),
206- edge_color,
207- background_tile_colorify,
208- arg.alpha,
209- force_filter,
210- tile_transform);
211+ // Mix edge_tile_colorify with plain white (1.0f).
212+ // Would be nicer to tweak value from HSV colorspace, instead.
213+ float mix_factor = (arg.system_item) ? 0.2f : 0.16f;
214+
215+ edge_tile_colorify.red = edge_tile_colorify.red * (1.0f - mix_factor) + 1.0f * mix_factor;
216+ edge_tile_colorify.green = edge_tile_colorify.green * (1.0f - mix_factor) + 1.0f * mix_factor;
217+ edge_tile_colorify.blue = edge_tile_colorify.blue * (1.0f - mix_factor) + 1.0f * mix_factor;
218 }
219+
220+ RenderElement(GfxContext,
221+ arg,
222+ edge->GetDeviceTexture(),
223+ edge_color,
224+ edge_tile_colorify,
225+ arg.alpha,
226+ force_filter,
227+ tile_transform);
228 // end tile draw
229
230 // draw icon
231@@ -1158,13 +1198,18 @@
232 generate_textures(icon_glow,
233 PKGDATADIR"/launcher_icon_glow_200.png",
234 PKGDATADIR"/launcher_icon_glow_62.png");
235+ generate_textures(icon_shadow,
236+ PKGDATADIR"/launcher_icon_shadow_200.png",
237+ PKGDATADIR"/launcher_icon_shadow_62.png");
238 generate_textures(icon_shine,
239 PKGDATADIR"/launcher_icon_shine_150.png",
240 PKGDATADIR"/launcher_icon_shine_54.png");
241
242 squircle_base = load_texture(PKGDATADIR"/squircle_base_54.png");
243 squircle_base_selected = load_texture(PKGDATADIR"/squircle_base_selected_54.png");
244- squircle_glow = load_texture(PKGDATADIR"/squircle_glow_54.png");
245+ squircle_edge = load_texture(PKGDATADIR"/squircle_edge_54.png");
246+ squircle_glow = load_texture(PKGDATADIR"/squircle_glow_62.png");
247+ squircle_shadow = load_texture(PKGDATADIR"/squircle_shadow_62.png");
248 squircle_shine = load_texture(PKGDATADIR"/squircle_shine_54.png");
249
250 pip_ltr = load_texture(PKGDATADIR"/launcher_pip_ltr.png");
251
252=== modified file 'plugins/unityshell/src/Launcher.cpp'
253--- plugins/unityshell/src/Launcher.cpp 2012-02-13 21:44:54 +0000
254+++ plugins/unityshell/src/Launcher.cpp 2012-02-13 22:48:18 +0000
255@@ -892,8 +892,10 @@
256 arg.progress = CLAMP(icon->GetProgress(), 0.0f, 1.0f);
257 arg.draw_shortcut = _shortcuts_shown && !_hide_machine->GetQuirk(LauncherHideMachine::PLACES_VISIBLE);
258 arg.system_item = icon->GetIconType() == AbstractLauncherIcon::TYPE_HOME;
259- arg.colorify_background = icon->GetIconType() == AbstractLauncherIcon::TYPE_HOME ||
260- icon->GetIconType() == AbstractLauncherIcon::TYPE_TRASH ||
261+ arg.colorify_background = icon->GetIconType() == AbstractLauncherIcon::TYPE_HOME ||
262+ icon->GetIconType() == AbstractLauncherIcon::TYPE_TRASH ||
263+ icon->GetIconType() == AbstractLauncherIcon::TYPE_DESKTOP ||
264+ icon->GetIconType() == AbstractLauncherIcon::TYPE_DEVICE ||
265 icon->GetIconType() == AbstractLauncherIcon::TYPE_EXPO;
266
267 if (_dash_is_open)