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

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

Issue 9969025: Fix compile warnings in Panel.xib (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 9 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/app/nibs/Panel.xib ('k') | 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 aa79ead2f181a60f98b61540095f58374d6572b8..37fa9eaf5573b5c6ad2ac69750eba1fe5f8e7f70 100644
--- a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
@@ -21,7 +21,6 @@
#include "ui/gfx/mac/nsimage_cache.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
-const int kRoundedCornerSize = 3;
const int kButtonPadding = 8;
const int kIconAndTextPadding = 5;
@@ -287,6 +286,7 @@ static NSEvent* MakeMouseEvent(NSEventType type,
[settingsButton_ setPressedOpacity:1.0];
[[settingsButton_ cell] setHighlightsBy:NSNoCellMask];
[self checkMouseAndUpdateSettingsButtonVisibility];
+ [self updateWrenchLayout];
[self updateCloseButtonLayout];
@@ -334,6 +334,15 @@ static NSEvent* MakeMouseEvent(NSEventType type,
return icon_;
}
+- (void)updateWrenchLayout {
+ NSRect bounds = [self bounds];
+ NSRect settingsButtonFrame = [settingsButtonWrapper_ frame];
+ settingsButtonFrame.origin.x = NSWidth(bounds) - NSWidth(settingsButtonFrame);
+ settingsButtonFrame.origin.y =
+ (NSHeight(bounds) - NSHeight(settingsButtonFrame)) / 2;
+ [settingsButtonWrapper_ setFrame:settingsButtonFrame];
+}
+
- (void)updateCloseButtonLayout {
NSRect buttonFrame = [closeButton_ frame];
NSRect bounds = [self bounds];
@@ -358,6 +367,8 @@ static NSEvent* MakeMouseEvent(NSEventType type,
- (void)updateIconAndTitleLayout {
NSRect closeButtonFrame = [closeButton_ frame];
NSRect iconFrame = [icon_ frame];
+ // NSTextField for title_ is set to Layout:Truncate, LineBreaks:TruncateTail
+ // in Interface Builder so it is sized in a single-line mode.
[title_ sizeToFit];
NSRect titleFrame = [title_ frame];
NSRect settingsButtonFrame = [settingsButtonWrapper_ frame];
@@ -403,6 +414,7 @@ static NSEvent* MakeMouseEvent(NSEventType type,
}
- (void)didChangeFrame:(NSNotification*)notification {
+ [self updateWrenchLayout];
[self updateIconAndTitleLayout];
}
« no previous file with comments | « chrome/app/nibs/Panel.xib ('k') | chrome/browser/ui/panels/panel_window_controller_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698