Merge lp:~3v1n0/unity/unfold-active-icon into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3989
Proposed branch: lp:~3v1n0/unity/unfold-active-icon
Merge into: lp:unity
Diff against target: 35 lines (+7/-1)
1 file modified
launcher/Launcher.cpp (+7/-1)
To merge this branch: bzr merge lp:~3v1n0/unity/unfold-active-icon
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+264054@code.launchpad.net

Commit message

Launcher: Always unfold an active icon

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Stephen M. Webb (bregma) wrote :

Is there a bug for this?

How do I test this?

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

Ouch, I thought I had linked the bug with the commit, but it doesn't seem the case...

Fixed it.

As for testing this, just fill your launcher with many icons so that you get the accordion effect, at that point, select one of running apps at the bottom, and it should be unfolded once activated.

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

LGTM.

review: Approve
Revision history for this message
Stephen M. Webb (bregma) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/Launcher.cpp'
2--- launcher/Launcher.cpp 2015-05-21 16:30:26 +0000
3+++ launcher/Launcher.cpp 2015-07-07 16:57:58 +0000
4@@ -677,7 +677,9 @@
5 // goes for 0.0f when fully unfolded, to 1.0f folded
6 float folding_progress = CLAMP((center.y + c_icon_size - folding_threshold) / (float) c_icon_size, 0.0f, 1.0f);
7 float unfold_progress = icon->GetQuirkProgress(AbstractLauncherIcon::Quirk::UNFOLDED, monitor());
8+ float active_progress = icon->GetQuirkProgress(AbstractLauncherIcon::Quirk::ACTIVE, monitor());
9
10+ unfold_progress = CLAMP(unfold_progress + active_progress, 0.0f, 1.0f);
11 folding_progress *= 1.0f - unfold_progress;
12
13 float half_size = (folded_size / 2.0f) + (c_icon_size / 2.0f - folded_size / 2.0f) * (1.0f - folding_progress);
14@@ -779,9 +781,12 @@
15 sum += height;
16
17 // magic constant must some day be explained, for now suffice to say this constant prevents the bottom from "marching";
18- float magic_constant = 1.3f;
19+ const float magic_constant = 1.3f;
20
21 float unfold_progress = (*it)->GetQuirkProgress(AbstractLauncherIcon::Quirk::UNFOLDED, monitor());
22+ float active_progress = (*it)->GetQuirkProgress(AbstractLauncherIcon::Quirk::ACTIVE, monitor());
23+
24+ unfold_progress = CLAMP(unfold_progress + active_progress, 0.0f, 1.0f);
25 folding_threshold -= CLAMP(sum - launcher_height, 0.0f, height * magic_constant) * (folding_constant + (1.0f - folding_constant) * unfold_progress);
26 }
27
28@@ -1597,6 +1602,7 @@
29 {
30 icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::VISIBLE, ANIM_DURATION_SHORT, monitor());
31 icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::RUNNING, ANIM_DURATION_SHORT, monitor());
32+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::ACTIVE, ANIM_DURATION_SHORT, monitor());
33 icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::STARTING, (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), monitor());
34 icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PULSE_ONCE, (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), monitor());
35 icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PRESENTED, ANIM_DURATION, monitor());