diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 20:20:55 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 20:20:55 +0000 |
commit | de8758e29710adfcdf53ec6c49ee2a78907bb953 (patch) | |
tree | 2cea657f9bc149d9ed31d8abd92268549ec64dac | |
parent | a9e00b45a794ca4d95f9d7ccd29cbad1b31afcf3 (diff) | |
download | chromium_src-de8758e29710adfcdf53ec6c49ee2a78907bb953.zip chromium_src-de8758e29710adfcdf53ec6c49ee2a78907bb953.tar.gz chromium_src-de8758e29710adfcdf53ec6c49ee2a78907bb953.tar.bz2 |
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
-rw-r--r-- | chrome/browser/gtk/tabs/dragged_tab_gtk.cc | 7 |
1 files changed, 5 insertions, 2 deletions
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 <algorithm> #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())); } } |