Merge lp:~unity-team/unity/unity.fix-1038138 into lp:unity

Proposed by Andrea Cimitan
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 2613
Proposed branch: lp:~unity-team/unity/unity.fix-1038138
Merge into: lp:unity
Diff against target: 48 lines (+15/-2)
1 file modified
unity-shared/IconRenderer.cpp (+15/-2)
To merge this branch: bzr merge lp:~unity-team/unity/unity.fix-1038138
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+120549@code.launchpad.net

Commit message

Fix bug 1038138 by applying some tweaks for tiles with backlight 0.0f

Description of the change

EDIT: TESTED works fine

I can't test this, cause unity trunk doesn't run in both of my notebooks, I used unity-standalone but I need proper testing.

It should fix the bug of the linked bugreport

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-shared/IconRenderer.cpp'
2--- unity-shared/IconRenderer.cpp 2012-08-21 10:33:07 +0000
3+++ unity-shared/IconRenderer.cpp 2012-08-21 15:21:18 +0000
4@@ -403,6 +403,7 @@
5 nux::Color edge_color(0x55555555);
6 nux::Color colorify = arg.colorify;
7 nux::Color background_tile_colorify = arg.colorify;
8+ bool colorify_background = arg.colorify_background;
9 float backlight_intensity = arg.backlight_intensity;
10 float glow_intensity = arg.glow_intensity;
11 float shadow_intensity = 0.6f;
12@@ -415,6 +416,18 @@
13
14 bool force_filter = icon_size != background->GetWidth();
15
16+ if (backlight_intensity == 0.0f)
17+ {
18+ // Colorize tiles without backlight with the launcher background color
19+ colorify_background = true;
20+ }
21+
22+ if (colorify_background)
23+ {
24+ // Extra tweaks for tiles that are colorized with the launcher background color
25+ background_tile_color = nux::color::White;
26+ }
27+
28 if (arg.keyboard_nav_hl)
29 {
30 background_tile_color = nux::color::White;
31@@ -434,7 +447,7 @@
32 colorify.blue += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.blue);
33 colorify.green += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.green);
34
35- if (arg.colorify_background)
36+ if (colorify_background)
37 {
38 background_tile_colorify = background_tile_colorify * 0.7f;
39 }
40@@ -494,7 +507,7 @@
41 edge_color = edge_color + ((background_tile_color - edge_color) * backlight_intensity);
42 nux::Color edge_tile_colorify = background_tile_colorify;
43
44- if (arg.colorify_background && !arg.keyboard_nav_hl)
45+ if (colorify_background && !arg.keyboard_nav_hl)
46 {
47 // Mix edge_tile_colorify with plain white (1.0f).
48 // Would be nicer to tweak value from HSV colorspace, instead.