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

Unified Diff: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm

Issue 404443008: [Mac] Fix the alignment of the new avatar button and the bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
index fdaf601d715bfbaef53c79c3258a076c8de0232b..d05be0a0d480491e575ba6ef0a48bcea68bb7bc1 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
@@ -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];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698