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

Unified Diff: views/view.h

Issue 118260: Review request - fix issue 6103 and 13217 -- mirror download item in download shelf (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « chrome/browser/views/download_item_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view.h
===================================================================
--- views/view.h (revision 17253)
+++ views/view.h (working copy)
@@ -346,6 +346,19 @@
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
« no previous file with comments | « chrome/browser/views/download_item_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698