unity-design team mailing list archive
-
unity-design team
-
Mailing list archive
-
Message #10077
[Merge] lp:~nick-dedekind/unity/lp893140.launcher-icon-feedback into lp:unity
Nick Dedekind has proposed merging lp:~nick-dedekind/unity/lp893140.launcher-icon-feedback into lp:unity.
Commit message:
Inverted launcher icon blink/pulse on application start for immediate feedback. (LP: #893140)
Requested reviews:
Ayatana Discussion (unity-design)
Unity Team (unity-team)
Related bugs:
Bug #893140 in Unity: "Launcher - The Launcher should provide instant visual feedback when a user clicks on a icon to launch an application"
https://bugs.launchpad.net/unity/+bug/893140
For more details, see:
https://code.launchpad.net/~nick-dedekind/unity/lp893140.launcher-icon-feedback/+merge/131576
Inverted launcher icon blink/pulse on application start for immediate feedback. (LP: #893140)
--
https://code.launchpad.net/~nick-dedekind/unity/lp893140.launcher-icon-feedback/+merge/131576
Your team Ayatana Discussion is requested to review the proposed merge of lp:~nick-dedekind/unity/lp893140.launcher-icon-feedback into lp:unity.
=== modified file 'launcher/Launcher.cpp'
--- launcher/Launcher.cpp 2012-10-18 00:27:52 +0000
+++ launcher/Launcher.cpp 2012-10-26 10:45:37 +0000
@@ -642,15 +642,27 @@
float Launcher::IconStartingBlinkValue(AbstractLauncherIcon::Ptr const& icon, struct timespec const& current) const
{
+ if (icon->GetQuirk(AbstractLauncherIcon::Quirk::RUNNING))
+ return 1.0f;
+
+ if (!icon->GetQuirk(AbstractLauncherIcon::Quirk::STARTING))
+ return 1.0f;
+
struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
int starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time);
double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * STARTING_BLINK_LAMBDA), 0.0f, 1.0f);
double val = IsBackLightModeToggles() ? 3.0f : 4.0f;
- return 0.5f + (float)(std::cos(M_PI * val * starting_progress)) * 0.5f;
+ return 1.0f-(0.5f + (float)(std::cos(M_PI * val * starting_progress)) * 0.5f);
}
float Launcher::IconStartingPulseValue(AbstractLauncherIcon::Ptr const& icon, struct timespec const& current) const
{
+ if (icon->GetQuirk(AbstractLauncherIcon::Quirk::RUNNING))
+ return 1.0f;
+
+ if (!icon->GetQuirk(AbstractLauncherIcon::Quirk::STARTING))
+ return 1.0f;
+
struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
int starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time);
double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f);
@@ -661,7 +673,7 @@
icon->ResetQuirkTime(AbstractLauncherIcon::Quirk::STARTING);
}
- return 0.5f + (float)(std::cos(M_PI * (float)(MAX_STARTING_BLINKS * 2) * starting_progress)) * 0.5f;
+ return 1.0f-(0.5f + (float)(std::cos(M_PI * (float)(MAX_STARTING_BLINKS * 2) * starting_progress)) * 0.5f);
}
float Launcher::IconBackgroundIntensity(AbstractLauncherIcon::Ptr const& icon, struct timespec const& current) const
References