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

Issue 545144: Position the the inactive toast to the left in RTL machines.... (Closed)

Created:
10 years, 11 months ago by cpu_(ooo_6.6-7.5)
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, ben+cc_chromium.org
Visibility:
Public.

Description

Position the the inactive toast to the left in RTL machines. BUG=32474 TEST=see bug for details Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=36762

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -4 lines) Patch
M chrome/browser/first_run_win.cc View 3 chunks +8 lines, -4 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
cpu_(ooo_6.6-7.5)
in RTL cases the toast is obscured by the start menu since the start menu ...
10 years, 11 months ago (2010-01-21 02:16:23 UTC) #1
Ben Goodger (Google)
10 years, 11 months ago (2010-01-21 03:46:17 UTC) #2
Ok

On Jan 20, 2010 6:16 PM, <cpu@chromium.org> wrote:

Reviewers: Ben Goodger,

Message:
in RTL cases the toast is obscured by the start menu since the start menu is
on
the right.

Description:
Position the the inactive toast to the left in RTL machines.

BUG=32474
TEST=see bug for details


Please review this at http://codereview.chromium.org/545144

SVN Base: svn://chrome-svn/chrome/trunk/src/

Affected files:
 M     chrome/browser/first_run_win.cc


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);
  }

Powered by Google App Engine
This is Rietveld 408576698