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

Unified Diff: chrome/browser/first_run_win.cc

Issue 545144: Position the the inactive toast to the left in RTL machines.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 11 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/first_run_win.cc
===================================================================
--- chrome/browser/first_run_win.cc (revision 36690)
+++ chrome/browser/first_run_win.cc (working copy)
@@ -835,7 +835,9 @@
// account the differences between XP and Vista fonts and buttons.
layout->Layout(root_view);
gfx::Size preferred = layout->GetPreferredSize(root_view);
- pos = ComputeWindowPosition(preferred.width(), preferred.height());
+ pos = ComputeWindowPosition(preferred.width(),
+ preferred.height(),
+ root_view->UILayoutIsRightToLeft());
popup->SetBounds(pos);
// Carve the toast shape into the window.
@@ -884,8 +886,10 @@
// Returns a screen rectangle that is fit to show the window. In particular
// it has the following properties: a) is visible and b) is attached to
- // the bottom of the working area.
- gfx::Rect ComputeWindowPosition(int width, int height) {
+ // the bottom of the working area. For LTR machines it returns a left side
+ // rectangle and for RTL it returns a right side rectangle so that the
+ // dialog does not compete with the standar place of the start menu.
+ gfx::Rect ComputeWindowPosition(int width, int height, bool is_RTL) {
// The 'Shell_TrayWnd' is the taskbar. We like to show our window in that
// monitor if we can. This code works even if such window is not found.
HWND taskbar = ::FindWindowW(L"Shell_TrayWnd", NULL);
@@ -898,7 +902,7 @@
}
// The |rcWork| is the work area. It should account for the taskbars that
// are in the screen when we called the function.
- int left = info.rcWork.right - width;
+ int left = is_RTL ? info.rcWork.left : info.rcWork.right - width;
int top = info.rcWork.bottom - height;
return gfx::Rect(left, top, width, height);
}
« 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