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

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

Issue 2689213011: [Mac RTL] Draw the drop arrow in the correct location when mirrored. (Closed)
Patch Set: Created 3 years, 10 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 ac56c5b6aa1f02730602ec168f632d7cc3b122f2..760d031e0026a4e9f1a08e8c80bfb1e71bb98879 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -2206,13 +2206,21 @@ NSRect FlipRectInView(NSView* view, NSRect rect) {
DCHECK(disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB);
NSInteger lastIndex = [tabArray_ count] - 1;
NSRect overRect = [[[tabArray_ objectAtIndex:lastIndex] view] frame];
- arrowPos.x = overRect.origin.x + overRect.size.width - kTabOverlap / 2.0;
+ if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
+ arrowPos.x = NSMinX(overRect) + kTabOverlap / 2.0;
+ } else {
+ arrowPos.x = NSMaxX(overRect) - kTabOverlap / 2.0;
+ }
} else {
NSRect overRect = [[[tabArray_ objectAtIndex:index] view] frame];
switch (disposition) {
case WindowOpenDisposition::NEW_FOREGROUND_TAB:
- // Insert tab (to the left of the given tab).
- arrowPos.x = overRect.origin.x + kTabOverlap / 2.0;
+ // Insert tab (before the given tab).
+ if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) {
+ arrowPos.x = NSMaxX(overRect) - kTabOverlap / 2.0;
+ } else {
+ arrowPos.x = NSMinX(overRect) + kTabOverlap / 2.0;
+ }
break;
case WindowOpenDisposition::CURRENT_TAB:
// Overwrite the given tab.
« 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