summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 18:04:01 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 18:04:01 +0000
commit079cac73023474c067653ed9da974b938acf53fb (patch)
tree96866bf6f98fc795274677dc277373838c85bf15
parent71d6ccaa326eab53fe98acaeb422228708d67235 (diff)
downloadchromium_src-079cac73023474c067653ed9da974b938acf53fb.zip
chromium_src-079cac73023474c067653ed9da974b938acf53fb.tar.gz
chromium_src-079cac73023474c067653ed9da974b938acf53fb.tar.bz2
With the Mac App Store, we see that window controls are no longer tied to the top of the window. Adjust ours downward so they have space to breathe.
BUG=68746 TEST=window widgets are vertically centered Review URL: http://codereview.chromium.org/6126001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70621 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/framed_browser_window.h16
-rw-r--r--chrome/browser/ui/cocoa/framed_browser_window.mm8
-rw-r--r--chrome/browser/ui/cocoa/tab_strip_controller.mm2
3 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/ui/cocoa/framed_browser_window.h b/chrome/browser/ui/cocoa/framed_browser_window.h
index 40f330c..d3fd68b 100644
--- a/chrome/browser/ui/cocoa/framed_browser_window.h
+++ b/chrome/browser/ui/cocoa/framed_browser_window.h
@@ -11,17 +11,15 @@
#include "base/scoped_nsobject.h"
#include "chrome/browser/ui/cocoa/chrome_browser_window.h"
-// Offset from the top of the window frame to the top of the window controls
-// (zoom, close, miniaturize) for a window with a tabstrip.
-const NSInteger kFramedWindowButtonsWithTabStripOffsetFromTop = 6;
+// Offsets from the top/left of the window frame to the top of the window
+// controls (zoom, close, miniaturize) for a window with a tabstrip.
+const NSInteger kFramedWindowButtonsWithTabStripOffsetFromTop = 10;
+const NSInteger kFramedWindowButtonsWithTabStripOffsetFromLeft = 10;
-// Offset from the top of the window frame to the top of the window controls
-// (zoom, close, miniaturize) for a window without a tabstrip.
+// Offsets from the top/left of the window frame to the top of the window
+// controls (zoom, close, miniaturize) for a window without a tabstrip.
const NSInteger kFramedWindowButtonsWithoutTabStripOffsetFromTop = 4;
-
-// Offset from the left of the window frame to the top of the window controls
-// (zoom, close, miniaturize).
-const NSInteger kFramedWindowButtonsOffsetFromLeft = 8;
+const NSInteger kFramedWindowButtonsWithoutTabStripOffsetFromLeft = 8;
// Offset between the window controls (zoom, close, miniaturize).
const NSInteger kFramedWindowButtonsInterButtonSpacing = 7;
diff --git a/chrome/browser/ui/cocoa/framed_browser_window.mm b/chrome/browser/ui/cocoa/framed_browser_window.mm
index 9d63cb7..46b3a98 100644
--- a/chrome/browser/ui/cocoa/framed_browser_window.mm
+++ b/chrome/browser/ui/cocoa/framed_browser_window.mm
@@ -118,13 +118,15 @@ namespace {
closeButton_ = [NSWindow standardWindowButton:NSWindowCloseButton
forStyleMask:aStyle];
NSRect closeButtonFrame = [closeButton_ frame];
+ CGFloat xOffset = [browserController hasTabStrip] ?
+ kFramedWindowButtonsWithTabStripOffsetFromLeft :
+ kFramedWindowButtonsWithoutTabStripOffsetFromLeft;
CGFloat yOffset = [browserController hasTabStrip] ?
kFramedWindowButtonsWithTabStripOffsetFromTop :
kFramedWindowButtonsWithoutTabStripOffsetFromTop;
closeButtonFrame.origin =
- NSMakePoint(kFramedWindowButtonsOffsetFromLeft,
- (NSHeight(frameViewBounds) -
- NSHeight(closeButtonFrame) - yOffset));
+ NSMakePoint(xOffset, (NSHeight(frameViewBounds) -
+ NSHeight(closeButtonFrame) - yOffset));
[closeButton_ setFrame:closeButtonFrame];
[closeButton_ setTarget:self];
diff --git a/chrome/browser/ui/cocoa/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tab_strip_controller.mm
index fa9f037..d9fb6fc 100644
--- a/chrome/browser/ui/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_strip_controller.mm
@@ -430,7 +430,7 @@ private:
+ (CGFloat)defaultIndentForControls {
// Default indentation leaves enough room so tabs don't overlap with the
// window controls.
- return 64.0;
+ return 68.0;
}
// Finds the TabContentsController associated with the given index into the tab