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
=== modified file 'launcher/LauncherController.cpp'
--- launcher/LauncherController.cpp 2012-10-04 08:00:29 +0000
+++ launcher/LauncherController.cpp 2012-10-10 16:40:27 +0000
@@ -384,12 +384,19 @@
384 // to compute its center384 // to compute its center
385 RegisterIcon(result, GetLastIconPriority<ApplicationLauncherIcon>("", true));385 RegisterIcon(result, GetLastIconPriority<ApplicationLauncherIcon>("", true));
386386
387 // This will ensure that the center of the new icon is set, so that387 if (icon_x > 0 || icon_y > 0)
388 // the animation could be done properly.388 {
389 sources_.AddIdle([this, icon_x, icon_y, result] {389 // This will ensure that the center of the new icon is set, so that
390 result->Animate(CurrentLauncher(), icon_x, icon_y);390 // the animation could be done properly.
391 return false;391 sources_.AddIdle([this, icon_x, icon_y, result] {
392 });392 result->Animate(CurrentLauncher(), icon_x, icon_y);
393 return false;
394 });
395 }
396 else
397 {
398 result->SetQuirk(AbstractLauncherIcon::Quirk::VISIBLE, true);
399 }
393 }400 }
394}401}
395402
396403
=== modified file 'launcher/SoftwareCenterLauncherIcon.cpp'
--- launcher/SoftwareCenterLauncherIcon.cpp 2012-10-04 08:00:29 +0000
+++ launcher/SoftwareCenterLauncherIcon.cpp 2012-10-10 16:40:27 +0000
@@ -30,6 +30,13 @@
30namespace launcher30namespace launcher
31{31{
3232
33namespace
34{
35#define SOURCE_SHOW_TOOLTIP "ShowTooltip"
36#define SOURCE_HIDE_TOOLTIP "HideTooltip"
37const int INSTALL_TIP_DURATION = 1500;
38}
39
33NUX_IMPLEMENT_OBJECT_TYPE(SoftwareCenterLauncherIcon);40NUX_IMPLEMENT_OBJECT_TYPE(SoftwareCenterLauncherIcon);
3441
35SoftwareCenterLauncherIcon::SoftwareCenterLauncherIcon(BamfApplication* app,42SoftwareCenterLauncherIcon::SoftwareCenterLauncherIcon(BamfApplication* app,
@@ -122,6 +129,17 @@
122 SetProgress(0.0f);129 SetProgress(0.0f);
123 finished_ = true;130 finished_ = true;
124 needs_urgent_ = true;131 needs_urgent_ = true;
132
133 sources_.AddIdle([this]()
134 {
135 ShowTooltip();
136 sources_.AddTimeout(INSTALL_TIP_DURATION, [this]()
137 {
138 HideTooltip();
139 return false;
140 }, SOURCE_HIDE_TOOLTIP);
141 return false;
142 }, SOURCE_SHOW_TOOLTIP);
125 }143 }
126 else144 else
127 {145 {
128146
=== modified file 'launcher/SoftwareCenterLauncherIcon.h'
--- launcher/SoftwareCenterLauncherIcon.h 2012-10-04 08:00:29 +0000
+++ launcher/SoftwareCenterLauncherIcon.h 2012-10-10 16:40:27 +0000
@@ -23,6 +23,7 @@
2323
24#include <string>24#include <string>
25#include <UnityCore/GLibDBusProxy.h>25#include <UnityCore/GLibDBusProxy.h>
26#include <UnityCore/GLibSource.h>
26#include "ApplicationLauncherIcon.h"27#include "ApplicationLauncherIcon.h"
27#include "LauncherDragWindow.h"28#include "LauncherDragWindow.h"
2829
@@ -59,6 +60,7 @@
59 nux::ObjectPtr<nux::IOpenGLBaseTexture> icon_texture_;60 nux::ObjectPtr<nux::IOpenGLBaseTexture> icon_texture_;
60 nux::ObjectPtr<LauncherDragWindow> drag_window_;61 nux::ObjectPtr<LauncherDragWindow> drag_window_;
61 nux::ObjectPtr<Launcher> launcher_;62 nux::ObjectPtr<Launcher> launcher_;
63 glib::SourceManager sources_;
62 bool finished_;64 bool finished_;
63 bool needs_urgent_;65 bool needs_urgent_;
6466