Commit f3dc55e3 authored by rdevlin.cronin's avatar rdevlin.cronin Committed by Commit bot

[Extensions Toolbar Mac] Fix chevron position after animation

If the chevron was animating in or out and then needs to move, the animation
should stop before the chevron's frame is set.

BUG=429810

Review URL: https://codereview.chromium.org/738213002

Cr-Commit-Position: refs/heads/master@{#305091}
parent 92fe70f9
......@@ -682,6 +682,7 @@ bool ToolbarActionsBarBridge::IsPopupRunning() const {
kBrowserActionOriginYOffset,
kChevronWidth,
ToolbarActionsBar::IconHeight());
[chevronAnimation_ stopAnimation];
[chevronMenuButton_ setFrame:buttonFrame];
}
......@@ -722,19 +723,17 @@ bool ToolbarActionsBarBridge::IsPopupRunning() const {
return;
}
NSDictionary* animationDictionary;
NSString* animationEffect;
if (hidden) {
animationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
chevronMenuButton_.get(), NSViewAnimationTargetKey,
NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey,
nil];
animationEffect = NSViewAnimationFadeOutEffect;
} else {
[chevronMenuButton_ setHidden:NO];
animationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
chevronMenuButton_.get(), NSViewAnimationTargetKey,
NSViewAnimationFadeInEffect, NSViewAnimationEffectKey,
nil];
animationEffect = NSViewAnimationFadeInEffect;
}
NSDictionary* animationDictionary = @{
NSViewAnimationTargetKey : chevronMenuButton_.get(),
NSViewAnimationEffectKey : animationEffect
};
[chevronAnimation_ setViewAnimations:
[NSArray arrayWithObject:animationDictionary]];
[chevronAnimation_ startAnimation];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment