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

Unified Diff: ui/views/window/non_client_view.cc

Issue 1866403005: Fix rtl shelf overflow bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move RTL adjustment (bubble_frame_view -> non_client_view) 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
« ash/shelf/shelf_view_unittest.cc ('K') | « ui/views/window/non_client_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/window/non_client_view.cc
diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc
index ed9dc4ab6479ac3363b62989cbe3e200fcff8501..2d89d75e229d70f96c3dcb2f08ccb49c41536413 100644
--- a/ui/views/window/non_client_view.cc
+++ b/ui/views/window/non_client_view.cc
@@ -43,6 +43,7 @@ bool NonClientFrameView::GetClientMask(const gfx::Size& size,
NonClientView::NonClientView()
: client_view_(nullptr),
+ mirror_client_in_rtl_(true),
overlay_view_(nullptr) {
SetEventTargeter(
std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
@@ -165,7 +166,14 @@ void NonClientView::Layout() {
LayoutFrameView();
// Then layout the ClientView, using those bounds.
- client_view_->SetBoundsRect(frame_view_->GetBoundsForClientView());
+ gfx::Rect client_bounds = frame_view_->GetBoundsForClientView();
+
+ // RTL code will mirror the ClientView in the frame by default. If this isn't
+ // desired, pre-mirror it here so the subsequent mirror results in a no-op.
sky 2016/04/29 17:17:27 nit: you're not doing pre-mirror here, rather anot
Greg Levin 2016/05/02 00:49:19 Done.
+ if (base::i18n::IsRTL() && !mirror_client_in_rtl_)
+ client_bounds.set_x(GetMirroredXForRect(client_bounds));
+
+ client_view_->SetBoundsRect(client_bounds);
gfx::Path client_clip;
if (frame_view_->GetClientMask(client_view_->size(), &client_clip))
« ash/shelf/shelf_view_unittest.cc ('K') | « ui/views/window/non_client_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698