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

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

Issue 8773030: Implement 3-stage minimize animation for Panels on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 9 years 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 | chrome/browser/ui/panels/panel_window_controller_cocoa.h » ('j') | 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 ef235be1e497860adb1253b3413b6a787ee1e936..452815b7af5d1837d04d11a984f022011b4b7229 100644
--- a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
@@ -212,7 +212,6 @@ static NSEvent* MakeMouseEvent(NSEventType type,
[[settingsButton_ cell] setHighlightsBy:NSNoCellMask];
[self checkMouseAndUpdateSettingsButtonVisibility];
- // Update layout of controls in the titlebar.
[self updateCloseButtonLayout];
// Set autoresizing behavior: glued to edges on left, top and right.
@@ -264,19 +263,20 @@ static NSEvent* MakeMouseEvent(NSEventType type,
NSRect bounds = [self bounds];
buttonFrame.origin.x = kButtonPadding;
- buttonFrame.origin.y = (NSHeight(bounds) - NSHeight(buttonFrame)) / 2;
+ // Lower Close Button's frame 1 px to avoid it 'peeking' in MINIMIZED mode.
+ buttonFrame.origin.y = (NSHeight(bounds) - NSHeight(buttonFrame)) / 2 - 1;
[closeButton_ setFrame:buttonFrame];
-
- DCHECK(!closeButtonTrackingArea_.get());
- closeButtonTrackingArea_.reset(
- [[CrTrackingArea alloc] initWithRect:buttonFrame
- options:(NSTrackingMouseEnteredAndExited |
- NSTrackingActiveAlways)
- proxiedOwner:self
- userInfo:nil]);
- NSWindow* panelWindow = [self window];
- [closeButtonTrackingArea_.get() clearOwnerWhenWindowWillClose:panelWindow];
- [self addTrackingArea:closeButtonTrackingArea_.get()];
+ if (!closeButtonTrackingArea_.get()) {
+ closeButtonTrackingArea_.reset(
+ [[CrTrackingArea alloc] initWithRect:[closeButton_ bounds]
+ options:(NSTrackingMouseEnteredAndExited |
+ NSTrackingActiveAlways)
+ proxiedOwner:self
+ userInfo:nil]);
+ NSWindow* panelWindow = [self window];
+ [closeButtonTrackingArea_.get() clearOwnerWhenWindowWillClose:panelWindow];
+ [closeButton_ addTrackingArea:closeButtonTrackingArea_.get()];
+ }
}
- (void)updateIconAndTitleLayout {
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_window_controller_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698