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

Unified Diff: chrome/browser/cocoa/extensions/browser_actions_controller.mm

Issue 2863013: [Mac] UI changes for the Browser Actions toolbar container.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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
Index: chrome/browser/cocoa/extensions/browser_actions_controller.mm
===================================================================
--- chrome/browser/cocoa/extensions/browser_actions_controller.mm (revision 50348)
+++ chrome/browser/cocoa/extensions/browser_actions_controller.mm (working copy)
@@ -40,10 +40,8 @@
const CGFloat kButtonOpacityLeadPadding = 5.0;
const CGFloat kChevronHeight = 28.0;
const CGFloat kChevronLowerPadding = 5.0;
-const CGFloat kChevronRightPadding = 5.0;
const CGFloat kChevronWidth = 14.0;
-const CGFloat kContainerPadding = 2.0;
-const CGFloat kGrippyXOffset = 8.0;
+const CGFloat kGrippyXOffset = 7.0;
} // namespace
@interface BrowserActionsController(Private)
@@ -345,7 +343,7 @@
profile_->GetPrefs()->GetReal(prefs::kBrowserActionContainerWidth);
if (predefinedWidth != 0) {
int iconWidth = kBrowserActionWidth + kBrowserActionButtonPadding;
- int extraWidth = kContainerPadding + kChevronWidth;
+ int extraWidth = kChevronWidth;
toolbarModel_->SetVisibleIconCount(
(predefinedWidth - extraWidth) / iconWidth);
}
@@ -552,22 +550,19 @@
- (CGFloat)containerWidthWithButtonCount:(NSUInteger)buttonCount {
CGFloat width = 0.0;
if (buttonCount > 0) {
- width = kGrippyXOffset + kContainerPadding +
+ width = kGrippyXOffset +
(buttonCount * (kBrowserActionWidth + kBrowserActionButtonPadding));
}
// Make room for the chevron if any buttons are hidden.
- if ([self buttonCount] != [self visibleButtonCount]) {
+ if ([self buttonCount] != [self visibleButtonCount])
width += kChevronWidth + kBrowserActionButtonPadding;
- // Add extra padding if all buttons are hidden.
- if ([self visibleButtonCount] == 0)
- width += 3 * kBrowserActionButtonPadding;
- }
+
return width;
}
- (NSUInteger)containerButtonCapacity {
CGFloat containerWidth = [self savedWidth];
- return (containerWidth - kGrippyXOffset + kContainerPadding) /
+ return (containerWidth - kGrippyXOffset) /
(kBrowserActionWidth + kBrowserActionButtonPadding);
}
@@ -733,7 +728,7 @@
}
- (void)updateChevronPositionInFrame:(NSRect)frame {
- CGFloat xPos = NSWidth(frame) - kChevronWidth - kChevronRightPadding;
+ CGFloat xPos = NSWidth(frame) - kChevronWidth;
NSRect buttonFrame = NSMakeRect(xPos,
kChevronLowerPadding,
kChevronWidth,
« no previous file with comments | « chrome/browser/cocoa/extensions/browser_actions_container_view.mm ('k') | chrome/browser/cocoa/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698