summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 18:32:22 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 18:32:22 +0000
commita40c12aad15ca01029dce484284b433527511d76 (patch)
tree4fe994e1862c4ffa0b64fe02428782fd299bcf98 /chrome/browser
parentb100b0ac92b05acb02a6926fbb2bb9bebabe99a5 (diff)
downloadchromium_src-a40c12aad15ca01029dce484284b433527511d76.zip
chromium_src-a40c12aad15ca01029dce484284b433527511d76.tar.gz
chromium_src-a40c12aad15ca01029dce484284b433527511d76.tar.bz2
Fixes bookmark menus so that they align properly when rtl.
BUG=5418 TEST=see bug Review URL: http://codereview.chromium.org/14053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/views/bookmark_manager_view.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc
index 1f39d0f..4971019 100644
--- a/chrome/browser/views/bookmark_manager_view.cc
+++ b/chrome/browser/views/bookmark_manager_view.cc
@@ -483,11 +483,14 @@ void BookmarkManagerView::RunMenu(views::View* source,
if (!GetBookmarkModel()->IsLoaded())
return;
+ int menu_x = pt.x;
+ menu_x += UILayoutIsRightToLeft() ? (source->width() - 5) :
+ (-source->width() + 5);
if (source->GetID() == kOrganizeMenuButtonID) {
- ShowMenu(hwnd, pt.x - source->width() + 5, pt.y + 2,
+ ShowMenu(hwnd, menu_x, pt.y + 2,
BookmarkContextMenu::BOOKMARK_MANAGER_ORGANIZE_MENU);
} else if (source->GetID() == kToolsMenuButtonID) {
- ShowToolsMenu(hwnd, pt.x - source->width() + 5, pt.y + 2);
+ ShowToolsMenu(hwnd, menu_x, pt.y + 2);
} else {
NOTREACHED();
}
@@ -696,8 +699,10 @@ void BookmarkManagerView::ShowToolsMenu(HWND host, int x, int y) {
menu.AppendMenuItemWithLabel(
IDS_BOOKMARK_MANAGER_EXPORT_MENU,
l10n_util::GetString(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
- menu.RunMenuAt(GetWidget()->GetHWND(), gfx::Rect(x, y, 0, 0),
- views::MenuItemView::TOPLEFT, true);
+ views::MenuItemView::AnchorPosition anchor =
+ UILayoutIsRightToLeft() ? views::MenuItemView::TOPRIGHT :
+ views::MenuItemView::TOPLEFT;
+ menu.RunMenuAt(GetWidget()->GetHWND(), gfx::Rect(x, y, 0, 0), anchor, true);
}
void BookmarkManagerView::ShowImportBookmarksFileChooser() {