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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 1866403005: Fix rtl shelf overflow bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 4 years, 8 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
« ui/views/bubble/bubble_frame_view.h ('K') | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index dbc4704b8029159c0e2285312c3e268d02e2c839..df024c6cc01aa0fab2e9a918d0a4aec18965e895 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -72,6 +72,7 @@ const char BubbleFrameView::kViewClassName[] = "BubbleFrameView";
BubbleFrameView::BubbleFrameView(const gfx::Insets& title_margins,
const gfx::Insets& content_margins)
: bubble_border_(nullptr),
+ mirror_arrow_in_rtl_(true),
title_margins_(title_margins),
content_margins_(content_margins),
title_icon_(new views::ImageView()),
@@ -120,6 +121,13 @@ LabelButton* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
gfx::Rect BubbleFrameView::GetBoundsForClientView() const {
gfx::Rect client_bounds = GetContentsBounds();
client_bounds.Inset(GetInsets());
+
+ // After GetBoundsForClientView() returns, RTL code will mirror the ClientView
+ // in the bubble. If we're not mirroring the arrow, we don't want this, so we
+ // pre-mirror here so the subsequent swap results in a no-op.
+ if (base::i18n::IsRTL() && !mirror_arrow_in_rtl_)
+ client_bounds.set_x(GetMirroredXForRect(client_bounds));
+
if (footnote_container_) {
client_bounds.set_height(client_bounds.height() -
footnote_container_->height());
« ui/views/bubble/bubble_frame_view.h ('K') | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698