diff options
author | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 18:01:47 +0000 |
---|---|---|
committer | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 18:01:47 +0000 |
commit | 14da3dff9c400ab44db52fd2c4349d8b3e3aa4b5 (patch) | |
tree | 2341deaff47bb2fd9b0c84ef62f2894dcaaf7e9f /views | |
parent | cc8f146d34a3b13cd80d8b3530fd76445774b1c6 (diff) | |
download | chromium_src-14da3dff9c400ab44db52fd2c4349d8b3e3aa4b5.zip chromium_src-14da3dff9c400ab44db52fd2c4349d8b3e3aa4b5.tar.gz chromium_src-14da3dff9c400ab44db52fd2c4349d8b3e3aa4b5.tar.bz2 |
This CL fixes issue 6103 -- Individual download items on the download shelf are not mirrored on RTL locales,
and issue 13217 -- Dangerous File warning on the shelf in RTL seems to misplace the buttons
Enable UI mirroring for DownloadItemView.
During painting each download items, for those items without corresponding mirrored images, flip the canvas to paint the mirrored image. And flip canvas back to normal to paint others.
BUG=http://crbug.com/6103
BUG=http://crbug.com/13217
Test=Open Hebrew Chrome, go to "http://build.chromium.org/buildbot/continuous/LATEST/", download mini_installer.exe, the layout of the warning should be "cancel_button ok_button warning_message warning_icon" from left to right. Click "ok" to download, the layout of the download item in download shelf should be "drop_down_icon download_file_name(or download_file_name with download_status) download_progress_animation and download icon" from left to right.
Review URL: http://codereview.chromium.org/118260
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/view.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/views/view.h b/views/view.h index 8075378..b4c459c 100644 --- a/views/view.h +++ b/views/view.h @@ -347,6 +347,19 @@ class View : public AcceleratorTarget { return UILayoutIsRightToLeft() ? width() - x : x; } + // Given a X coordinate and a width inside the View, this function returns + // the mirrored X coordinate if the View's UI layout is right-to-left. If the + // layout is left-to-right, the same X coordinate is returned. + // + // Following are a few examples of the values returned by this function for + // a View with the bounds {0, 0, 100, 100} and a right-to-left layout: + // + // MirroredXCoordinateInsideView(0, 10) -> 90 + // MirroredXCoordinateInsideView(20, 20) -> 60 + int MirroredXWithWidthInsideView(int x, int w) const { + return UILayoutIsRightToLeft() ? width() - x - w : x; + } + // Painting functions // Mark the specified rectangle as dirty (needing repaint). If |urgent| is |