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

Unified Diff: chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm

Issue 8365020: Update Panel titlebar text and icon layout when resized on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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/ui/panels/panel_titlebar_view_cocoa.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
diff --git a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
index bc866b095deeccbecd3d05e0c013b2ae97202287..2cbab4d3c8bea0a8cfabad431d9feeca43804b55 100644
--- a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
@@ -194,7 +194,6 @@ static NSEvent* MakeMouseEvent(NSEventType type,
// Update layout of controls in the titlebar.
[self updateCloseButtonLayout];
- [self updateIconAndTitleLayout];
// Set autoresizing behavior: glued to edges on left, top and right.
[self setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)];
@@ -204,8 +203,11 @@ static NSEvent* MakeMouseEvent(NSEventType type,
selector:@selector(didChangeTheme:)
name:kBrowserThemeDidChangeNotification
object:nil];
- // Register for various window focus changes, so we can update our custom
- // titlebar appropriately.
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(didChangeFrame:)
+ name:NSViewFrameDidChangeNotification
+ object:self];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(didChangeMainWindow:)
@@ -300,6 +302,10 @@ static NSEvent* MakeMouseEvent(NSEventType type,
[[closeButton_ cell] setHighlighted:NO];
}
+- (void)didChangeFrame:(NSNotification*)notification {
+ [self updateIconAndTitleLayout];
+}
+
- (void)didChangeTheme:(NSNotification*)notification {
[self setNeedsDisplay:YES];
}
@@ -411,6 +417,10 @@ static NSEvent* MakeMouseEvent(NSEventType type,
return controller_;
}
+- (NSTextField*)title {
+ return title_;
+}
+
- (void)simulateCloseButtonClick {
[[closeButton_ cell] performClick:closeButton_];
}
« no previous file with comments | « chrome/browser/ui/panels/panel_titlebar_view_cocoa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698