Merge lp:~nick-dedekind/unity/lp1052582.usc-icon-animation into lp:unity

Proposed by Nick Dedekind
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2825
Proposed branch: lp:~nick-dedekind/unity/lp1052582.usc-icon-animation
Merge into: lp:unity
Diff against target: 84 lines (+33/-6)
3 files modified
launcher/LauncherController.cpp (+13/-6)
launcher/SoftwareCenterLauncherIcon.cpp (+18/-0)
launcher/SoftwareCenterLauncherIcon.h (+2/-0)
To merge this branch: bzr merge lp:~nick-dedekind/unity/lp1052582.usc-icon-animation
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
jenkins continuous-integration Pending
Review via email: mp+126277@code.launchpad.net

Commit message

Only animate drag icon with USC icon if sourced from a valid point on screen.
Added tool-tip animation when app installation completes.

Description of the change

Only animate drag icon with USC icon if sourced from a valid point on screen.
Added tool-tip animation when app installation completes.

To post a comment you must log in.
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Looks good to me. +1 (Just need to fix a conflict)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherController.cpp'
2--- launcher/LauncherController.cpp 2012-10-04 08:00:29 +0000
3+++ launcher/LauncherController.cpp 2012-10-10 16:40:27 +0000
4@@ -384,12 +384,19 @@
5 // to compute its center
6 RegisterIcon(result, GetLastIconPriority<ApplicationLauncherIcon>("", true));
7
8- // This will ensure that the center of the new icon is set, so that
9- // the animation could be done properly.
10- sources_.AddIdle([this, icon_x, icon_y, result] {
11- result->Animate(CurrentLauncher(), icon_x, icon_y);
12- return false;
13- });
14+ if (icon_x > 0 || icon_y > 0)
15+ {
16+ // This will ensure that the center of the new icon is set, so that
17+ // the animation could be done properly.
18+ sources_.AddIdle([this, icon_x, icon_y, result] {
19+ result->Animate(CurrentLauncher(), icon_x, icon_y);
20+ return false;
21+ });
22+ }
23+ else
24+ {
25+ result->SetQuirk(AbstractLauncherIcon::Quirk::VISIBLE, true);
26+ }
27 }
28 }
29
30
31=== modified file 'launcher/SoftwareCenterLauncherIcon.cpp'
32--- launcher/SoftwareCenterLauncherIcon.cpp 2012-10-04 08:00:29 +0000
33+++ launcher/SoftwareCenterLauncherIcon.cpp 2012-10-10 16:40:27 +0000
34@@ -30,6 +30,13 @@
35 namespace launcher
36 {
37
38+namespace
39+{
40+#define SOURCE_SHOW_TOOLTIP "ShowTooltip"
41+#define SOURCE_HIDE_TOOLTIP "HideTooltip"
42+const int INSTALL_TIP_DURATION = 1500;
43+}
44+
45 NUX_IMPLEMENT_OBJECT_TYPE(SoftwareCenterLauncherIcon);
46
47 SoftwareCenterLauncherIcon::SoftwareCenterLauncherIcon(BamfApplication* app,
48@@ -122,6 +129,17 @@
49 SetProgress(0.0f);
50 finished_ = true;
51 needs_urgent_ = true;
52+
53+ sources_.AddIdle([this]()
54+ {
55+ ShowTooltip();
56+ sources_.AddTimeout(INSTALL_TIP_DURATION, [this]()
57+ {
58+ HideTooltip();
59+ return false;
60+ }, SOURCE_HIDE_TOOLTIP);
61+ return false;
62+ }, SOURCE_SHOW_TOOLTIP);
63 }
64 else
65 {
66
67=== modified file 'launcher/SoftwareCenterLauncherIcon.h'
68--- launcher/SoftwareCenterLauncherIcon.h 2012-10-04 08:00:29 +0000
69+++ launcher/SoftwareCenterLauncherIcon.h 2012-10-10 16:40:27 +0000
70@@ -23,6 +23,7 @@
71
72 #include <string>
73 #include <UnityCore/GLibDBusProxy.h>
74+#include <UnityCore/GLibSource.h>
75 #include "ApplicationLauncherIcon.h"
76 #include "LauncherDragWindow.h"
77
78@@ -59,6 +60,7 @@
79 nux::ObjectPtr<nux::IOpenGLBaseTexture> icon_texture_;
80 nux::ObjectPtr<LauncherDragWindow> drag_window_;
81 nux::ObjectPtr<Launcher> launcher_;
82+ glib::SourceManager sources_;
83 bool finished_;
84 bool needs_urgent_;
85