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

Unified Diff: chrome/browser/ui/views/toolbar/app_menu.cc

Issue 2452183002: Fix separator positioning in app menu dropdown in RTL. (Closed)
Patch Set: Created 4 years, 2 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/toolbar/app_menu.cc
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 45f98c66509ebbbe1f8fb17240aa95807a8a1e34..2c3a7c74a68c009eca2d3b9edf90e7cdb8d6201a 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -158,12 +158,13 @@ class InMenuButtonBackground : public views::Background {
button ? button->state() : views::Button::STATE_NORMAL;
int h = view->height();
- // Draw leading border where needed. This is along the left edge unless the
- // layout is RTL and the button isn't mirroring itself.
+ // Draw leading border if desired.
gfx::Rect bounds(view->GetLocalBounds());
if (type_ == LEADING_BORDER) {
+ // We need to flip the canvas for RTL iff the button is not auto-flipping
+ // already, so we end up flipping exactly once.
gfx::ScopedRTLFlipCanvas scoped_canvas(
- canvas, view->width(), view->flip_canvas_on_paint_for_rtl_ui());
+ canvas, view->width(), !view->flip_canvas_on_paint_for_rtl_ui());
canvas->FillRect(gfx::Rect(0, 0, 1, h),
BorderColor(view, views::Button::STATE_NORMAL));
bounds.Inset(gfx::Insets(0, 1, 0, 0));
« 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