Commit f2224092 authored by noms@chromium.org's avatar noms@chromium.org

[Mac] Fix the alignment of the new avatar button and the bubble.

Before: https://drive.google.com/file/d/0B1B1Up4p2NRMLTQ1ZFc0blIwbzA/edit?usp=sharing
After: https://drive.google.com/file/d/0B1B1Up4p2NRMVUloNWhYY1luQjg/edit?usp=sharing

BUG=NONE
TEST=Start Chrome with --new-profile-management. Click on the avatar button.
The bubble's right edge should be perfectly aligned to the button's edge.

Review URL: https://codereview.chromium.org/404443008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284603 0039d316-1c4b-4281-b951-d872f2087c98
parent 3a70be9b
......@@ -26,6 +26,9 @@
// Space between the avatar icon and the avatar menu bubble.
const CGFloat kMenuYOffsetAdjust = 1.0;
// Offset needed to align the edge of the avatar bubble with the edge of the
// avatar button.
const CGFloat kMenuXOffsetAdjust = 2.0;
@interface AvatarBaseController (Private)
// Shows the avatar bubble.
......@@ -153,8 +156,9 @@ class ProfileInfoUpdateObserver : public ProfileInfoCacheObserver,
// The new avatar bubble does not have an arrow, and it should be anchored
// to the edge of the avatar button.
int anchorX = switches::IsNewAvatarMenu() ? NSMaxX([anchor bounds]) :
NSMidX([anchor bounds]);
int anchorX = switches::IsNewAvatarMenu() ?
NSMaxX([anchor bounds]) - kMenuXOffsetAdjust :
NSMidX([anchor bounds]);
NSPoint point = NSMakePoint(anchorX,
NSMaxY([anchor bounds]) - kMenuYOffsetAdjust);
point = [anchor convertPoint:point toView:nil];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment