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

Unified Diff: chrome/browser/ui/views/tabs/base_tab.cc

Issue 10701024: Fix eliding of LTR tab title in RTL UI under non-Windows Views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/views/tabs/base_tab.cc
===================================================================
--- chrome/browser/ui/views/tabs/base_tab.cc (revision 144784)
+++ chrome/browser/ui/views/tabs/base_tab.cc (working copy)
@@ -547,9 +547,15 @@
canvas->DrawFadeTruncatingString(title, gfx::Canvas::TruncateFadeTail, 0,
*font_, title_color, title_bounds);
#else
+ int flags = gfx::Canvas::TEXT_ALIGN_LEFT;
+ if (base::i18n::IsRTL() &&
+ base::i18n::GetFirstStrongCharacterDirection(title) !=
+ base::i18n::LEFT_TO_RIGHT) {
+ flags = gfx::Canvas::TEXT_ALIGN_RIGHT;
+ }
xji 2012/06/29 18:11:24 Since RenderText has both directionality and horiz
canvas->DrawStringInt(title, *font_, title_color,
title_bounds.x(), title_bounds.y(),
- title_bounds.width(), title_bounds.height());
+ title_bounds.width(), title_bounds.height(), flags);
#endif
}
« 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