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 { ...@@ -682,6 +682,7 @@ bool ToolbarActionsBarBridge::IsPopupRunning() const {
kBrowserActionOriginYOffset, kBrowserActionOriginYOffset,
kChevronWidth, kChevronWidth,
ToolbarActionsBar::IconHeight()); ToolbarActionsBar::IconHeight());
[chevronAnimation_ stopAnimation];
[chevronMenuButton_ setFrame:buttonFrame]; [chevronMenuButton_ setFrame:buttonFrame];
} }
...@@ -722,19 +723,17 @@ bool ToolbarActionsBarBridge::IsPopupRunning() const { ...@@ -722,19 +723,17 @@ bool ToolbarActionsBarBridge::IsPopupRunning() const {
return; return;
} }
NSDictionary* animationDictionary; NSString* animationEffect;
if (hidden) { if (hidden) {
animationDictionary = [NSDictionary dictionaryWithObjectsAndKeys: animationEffect = NSViewAnimationFadeOutEffect;
chevronMenuButton_.get(), NSViewAnimationTargetKey,
NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey,
nil];
} else { } else {
[chevronMenuButton_ setHidden:NO]; [chevronMenuButton_ setHidden:NO];
animationDictionary = [NSDictionary dictionaryWithObjectsAndKeys: animationEffect = NSViewAnimationFadeInEffect;
chevronMenuButton_.get(), NSViewAnimationTargetKey,
NSViewAnimationFadeInEffect, NSViewAnimationEffectKey,
nil];
} }
NSDictionary* animationDictionary = @{
NSViewAnimationTargetKey : chevronMenuButton_.get(),
NSViewAnimationEffectKey : animationEffect
};
[chevronAnimation_ setViewAnimations: [chevronAnimation_ setViewAnimations:
[NSArray arrayWithObject:animationDictionary]]; [NSArray arrayWithObject:animationDictionary]];
[chevronAnimation_ startAnimation]; [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