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
=== modified file 'unity-shared/IconRenderer.cpp'
--- unity-shared/IconRenderer.cpp 2012-08-21 10:33:07 +0000
+++ unity-shared/IconRenderer.cpp 2012-08-21 15:21:18 +0000
@@ -403,6 +403,7 @@
403 nux::Color edge_color(0x55555555);403 nux::Color edge_color(0x55555555);
404 nux::Color colorify = arg.colorify;404 nux::Color colorify = arg.colorify;
405 nux::Color background_tile_colorify = arg.colorify;405 nux::Color background_tile_colorify = arg.colorify;
406 bool colorify_background = arg.colorify_background;
406 float backlight_intensity = arg.backlight_intensity;407 float backlight_intensity = arg.backlight_intensity;
407 float glow_intensity = arg.glow_intensity;408 float glow_intensity = arg.glow_intensity;
408 float shadow_intensity = 0.6f;409 float shadow_intensity = 0.6f;
@@ -415,6 +416,18 @@
415416
416 bool force_filter = icon_size != background->GetWidth();417 bool force_filter = icon_size != background->GetWidth();
417418
419 if (backlight_intensity == 0.0f)
420 {
421 // Colorize tiles without backlight with the launcher background color
422 colorify_background = true;
423 }
424
425 if (colorify_background)
426 {
427 // Extra tweaks for tiles that are colorized with the launcher background color
428 background_tile_color = nux::color::White;
429 }
430
418 if (arg.keyboard_nav_hl)431 if (arg.keyboard_nav_hl)
419 {432 {
420 background_tile_color = nux::color::White;433 background_tile_color = nux::color::White;
@@ -434,7 +447,7 @@
434 colorify.blue += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.blue);447 colorify.blue += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.blue);
435 colorify.green += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.green);448 colorify.green += (0.5f + 0.5f * arg.saturation) * (1.0f - colorify.green);
436449
437 if (arg.colorify_background)450 if (colorify_background)
438 {451 {
439 background_tile_colorify = background_tile_colorify * 0.7f;452 background_tile_colorify = background_tile_colorify * 0.7f;
440 }453 }
@@ -494,7 +507,7 @@
494 edge_color = edge_color + ((background_tile_color - edge_color) * backlight_intensity);507 edge_color = edge_color + ((background_tile_color - edge_color) * backlight_intensity);
495 nux::Color edge_tile_colorify = background_tile_colorify;508 nux::Color edge_tile_colorify = background_tile_colorify;
496509
497 if (arg.colorify_background && !arg.keyboard_nav_hl)510 if (colorify_background && !arg.keyboard_nav_hl)
498 {511 {
499 // Mix edge_tile_colorify with plain white (1.0f).512 // Mix edge_tile_colorify with plain white (1.0f).
500 // Would be nicer to tweak value from HSV colorspace, instead.513 // Would be nicer to tweak value from HSV colorspace, instead.