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

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: Small review fixes (and merge) 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
« no previous file with comments | « 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..1cb6bc374c05f682dbe924dcbfbaad3fc1cb0ece 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, do a second mirror here to get the standard LTR position.
+ 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))
« no previous file with comments | « 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