summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/launcher/launcher_view.cc19
-rw-r--r--ash/launcher/launcher_view.h3
2 files changed, 20 insertions, 2 deletions
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index 53ff7c2..3c82686 100644
--- a/ash/launcher/launcher_view.cc
+++ b/ash/launcher/launcher_view.cc
@@ -267,7 +267,7 @@ void ReflectItemStatus(const ash::LauncherItem& item,
} // namespace
-// AnimationDelegate used when inserting a new item. This steadily decreased the
+// AnimationDelegate used when deleting an item. This steadily decreased the
// opacity of the layer as the animation progress.
class LauncherView::FadeOutAnimationDelegate
: public views::BoundsAnimator::OwnedAnimationDelegate {
@@ -283,7 +283,7 @@ class LauncherView::FadeOutAnimationDelegate
view_->layer()->ScheduleDraw();
}
virtual void AnimationEnded(const Animation* animation) OVERRIDE {
- launcher_view_->AnimateToIdealBounds();
+ launcher_view_->OnFadeOutAnimationEnded();
}
virtual void AnimationCanceled(const Animation* animation) OVERRIDE {
}
@@ -847,6 +847,21 @@ void LauncherView::UpdateFirstButtonPadding() {
}
}
+void LauncherView::OnFadeOutAnimationEnded() {
+ AnimateToIdealBounds();
+
+ // If overflow button is visible, fading the new lat item in after sliding
+ // animation is finished.
+ if (overflow_button_->visible()) {
+ views::View* last_visible_view = view_model_->view_at(last_visible_index_);
+ last_visible_view->layer()->SetOpacity(0);
+ bounds_animator_->SetAnimationDelegate(
+ last_visible_view,
+ new LauncherView::StartFadeAnimationDelegate(this, last_visible_view),
+ true);
+ }
+}
+
bool LauncherView::ShouldHideTooltip(const gfx::Point& cursor_location) {
gfx::Rect active_bounds;
diff --git a/ash/launcher/launcher_view.h b/ash/launcher/launcher_view.h
index 5ccc8b2..0e57169 100644
--- a/ash/launcher/launcher_view.h
+++ b/ash/launcher/launcher_view.h
@@ -177,6 +177,9 @@ class ASH_EXPORT LauncherView : public views::View,
// button creation and every time when shelf alignment is changed.
void UpdateFirstButtonPadding();
+ // Invoked after the fading out animation for item deletion is ended.
+ void OnFadeOutAnimationEnded();
+
// Overridden from views::View:
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;