Chromium Code Reviews
Help | Chromium Project | Sign in
(500)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 3 months ago by cpu_(out until 23rd)
Modified:
2 years, 11 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) Lint Patch
M chrome/browser/first_run_win.cc View 3 chunks +8 lines, -4 lines 0 comments 0 errors Download
Commit:

Messages

Total messages: 2
cpu_(out until 23rd)
in RTL cases the toast is obscured by the start menu since the start menu ...
4 years, 3 months ago #1
Ben Goodger (Google)
4 years, 3 months ago #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);
  }
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6