Merge lp:~3v1n0/unity/fading-launcher-autohide-dash into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3501
Proposed branch: lp:~3v1n0/unity/fading-launcher-autohide-dash
Merge into: lp:unity
Diff against target: 67 lines (+13/-3)
2 files modified
launcher/Launcher.cpp (+11/-3)
launcher/Launcher.h (+2/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/fading-launcher-autohide-dash
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Christopher Townsend Approve
Review via email: mp+185104@code.launchpad.net

Commit message

Launcher: only fade the launcher when in auto-hide and dash is opened

Description of the change

Only fade the launcher when is in auto-hide mode and the dash is shown (in general via super key).
Also reduce the animation duration in this case to match the one of the dash.

John approved this visual change.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

I think the visuals definitely look better and the fade in works. However, I see the Dash fade in first and then a split second later, I see the Launcher fade in into the space where the Launcher should be. I'm not sure if this intended behavior, but to me, it would be more visually appealing if the Dash and the Launcher faded in at the same time. If this is intended behavior, just let me know, and I'll approve this since it works and the code is good.

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

> I think the visuals definitely look better and the fade in works. However, I
> see the Dash fade in first and then a split second later, I see the Launcher
> fade in into the space where the Launcher should be. I'm not sure if this
> intended behavior, but to me, it would be more visually appealing if the Dash
> and the Launcher faded in at the same time. If this is intended behavior,
> just let me know, and I'll approve this since it works and the code is good.

Mh, I didn't notice that on my main monitor, but it happens on the secondary one....
The main cause for that is due to the fact that we're using different animation approaches on these views, and this leads to different times.

However, using the nux::Animator for this task seems doable in the launcher as well, and so that's what I've done now.

Revision history for this message
Christopher Townsend (townsend) wrote :

Awesome, I think this looks better. +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

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 2013-09-11 16:47:48 +0000
3+++ launcher/Launcher.cpp 2013-09-12 10:41:30 +0000
4@@ -159,6 +159,7 @@
5 , _last_reveal_progress(0.0f)
6 , _drag_action(nux::DNDACTION_NONE)
7 , _selection_atom(0)
8+ , dash_showing_animation_(90)
9 , icon_renderer(std::make_shared<ui::IconRenderer>())
10 {
11 m_Layout = new nux::HLayout(NUX_TRACKER_LOCATION);
12@@ -1052,9 +1053,12 @@
13 *launcher_alpha = 1.0f;
14 if (options()->hide_mode != LAUNCHER_HIDE_NEVER || _hide_machine.GetQuirk(LauncherHideMachine::LOCK_HIDE))
15 {
16-
17 float autohide_progress = AutohideProgress(current) * (1.0f - DragOutProgress(current));
18- if (options()->auto_hide_animation() == FADE_ONLY)
19+ if (_dash_is_open)
20+ {
21+ *launcher_alpha = dash_showing_animation_.GetCurrentValue();
22+ }
23+ else if (options()->auto_hide_animation() == FADE_ONLY)
24 {
25 *launcher_alpha = 1.0f - autohide_progress;
26 }
27@@ -1259,6 +1263,9 @@
28 _dash_is_open = true;
29 _hide_machine.SetQuirk(LauncherHideMachine::PLACES_VISIBLE, true);
30 _hover_machine.SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, true);
31+
32+ if (options()->hide_mode != LAUNCHER_HIDE_NEVER)
33+ dash_showing_animation_.SetStartValue(0.0f).SetFinishValue(1.0f).Start();
34 }
35 if (identity == "hud")
36 {
37@@ -1299,9 +1306,10 @@
38 {
39 if (identity == "dash")
40 {
41+ _dash_is_open = false;
42 _hide_machine.SetQuirk(LauncherHideMachine::PLACES_VISIBLE, false);
43 _hover_machine.SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, false);
44- _dash_is_open = false;
45+ dash_showing_animation_.Stop();
46 }
47 else if (identity == "hud")
48 {
49
50=== modified file 'launcher/Launcher.h'
51--- launcher/Launcher.h 2013-09-11 16:47:48 +0000
52+++ launcher/Launcher.h 2013-09-12 10:41:30 +0000
53@@ -24,6 +24,7 @@
54 #include <Nux/View.h>
55 #include <Nux/BaseWindow.h>
56 #include <Nux/TimerProc.h>
57+#include <NuxCore/Animation.h>
58 #include <NuxGraphics/GestureEvent.h>
59 #ifndef USE_GLES
60 # include <NuxGraphics/IOpenGLAsmShader.h>
61@@ -408,6 +409,7 @@
62 BaseTexturePtr launcher_sheen_;
63 BaseTexturePtr launcher_pressure_effect_;
64
65+ nux::animation::AnimateValue<double> dash_showing_animation_;
66 ui::AbstractIconRenderer::Ptr icon_renderer;
67 BackgroundEffectHelper bg_effect_helper_;
68