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

Unified Diff: chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm

Issue 18199004: Fix bug with the avatar menu alignment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid flicker by calculating new origin in setWindowFrame. Created 7 years, 6 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/browser/avatar_menu_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm
index 4514695e284022364996a1722636c0f136b3b2ce..26e5ec95b10893d0d0db7da3fd177e119122c60f 100644
--- a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm
@@ -183,11 +183,13 @@ const CGFloat kManagedUserSpacing = 26.0;
NSRect frame = [[self window] frame];
// Adjust the origin after we have switched from the managed user menu to the
// regular menu.
- if (expanded_)
+ CGFloat newWidth = std::min(kBubbleMinWidth + width, kBubbleMaxWidth);
+ if (expanded_) {
+ frame.origin.x += frame.size.width - newWidth;
frame.origin.y += frame.size.height - yOffset;
+ }
frame.size.height = yOffset;
- frame.size.width = kBubbleMinWidth + width;
- frame.size.width = std::min(NSWidth(frame), kBubbleMaxWidth);
+ frame.size.width = newWidth;
[[self window] setFrame:frame display:YES];
}
« 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