Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 2407413004: [Mac] Make new tab button animation RTL-aware (Closed)
Patch Set: Stray Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index d380384d8778ccfec5f89e8513b72c61afc6de5f..97eb5f57a8c69e4dc60dc633054ae5fa214548fe 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -1180,14 +1180,17 @@ CGFloat FlipXInView(NSView* view, CGFloat width, CGFloat x) {
[self setNewTabButtonHoverState:shouldShowHover];
// Move the new tab button into place. We want to animate the new tab
- // button if it's moving to the left (closing a tab), but not when it's
- // moving to the right (inserting a new tab). If moving right, we need
+ // button if it's moving back (closing a tab), but not when it's
+ // moving forward (inserting a new tab). If moving forward, we need
// to use a very small duration to make sure we cancel any in-flight
// animation to the left.
if (visible && animate) {
ScopedNSAnimationContextGroup localAnimationGroup(true);
- BOOL movingLeft = NSMinX(newTabNewFrame) < NSMinX(newTabTargetFrame_);
- if (!movingLeft) {
+ BOOL movingBack = NSMinX(newTabNewFrame) < NSMinX(newTabTargetFrame_);
+ if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout())
+ movingBack = !movingBack;
+
+ if (!movingBack) {
localAnimationGroup.SetCurrentContextShortestDuration();
}
[[newTabButton_ animator] setFrame:newTabNewFrame];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698