From de8758e29710adfcdf53ec6c49ee2a78907bb953 Mon Sep 17 00:00:00 2001 From: "jhawkins@chromium.org" Date: Thu, 16 Jul 2009 20:20:55 +0000 Subject: gtk: Handle RTL layout when rendering the dragged tab. BUG=none TEST=Drag a tab out of the browser in a RTL language. The tab should be rendered on the right side of the container. Review URL: http://codereview.chromium.org/155643 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20890 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/tabs/dragged_tab_gtk.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index afe79c7..0f0c4f7 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -9,6 +9,7 @@ #include #include "app/gfx/canvas_paint.h" +#include "app/l10n_util.h" #include "base/gfx/gtk_util.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -166,12 +167,14 @@ void DraggedTabGtk::Layout() { gfx::Size prefsize = GetPreferredSize(); renderer_->SetBounds(gfx::Rect(0, 0, prefsize.width(), prefsize.height())); } else { - // TODO(jhawkins): RTL layout. + int left = 0; + if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) + left = GetPreferredSize().width() - attached_tab_size_.width(); // The renderer_'s width should be attached_tab_size_.width() in both LTR // and RTL locales. Wrong width will cause the wrong positioning of the tab // view in dragging. Please refer to http://crbug.com/6223 for details. - renderer_->SetBounds(gfx::Rect(0, 0, attached_tab_size_.width(), + renderer_->SetBounds(gfx::Rect(left, 0, attached_tab_size_.width(), attached_tab_size_.height())); } } -- cgit v1.1