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

Unified Diff: chrome/browser/cocoa/extensions/browser_actions_container_view.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_container_view.mm
===================================================================
--- chrome/browser/cocoa/extensions/browser_actions_container_view.mm (revision 50348)
+++ chrome/browser/cocoa/extensions/browser_actions_container_view.mm (working copy)
@@ -18,24 +18,14 @@
namespace {
const CGFloat kAnimationDuration = 0.2;
-const CGFloat kGrippyLowerPadding = 4.0;
-const CGFloat kGrippyUpperPadding = 8.0;
-const CGFloat kGrippyWidth = 10.0;
-const CGFloat kLowerPadding = 5.0;
+const CGFloat kGrippyWidth = 8.0;
const CGFloat kMinimumContainerWidth = 10.0;
-const CGFloat kRightBorderXOffset = -1.0;
-const CGFloat kRightBorderWidth = 1.0;
-const CGFloat kRightBorderGrayscale = 0.5;
-const CGFloat kUpperPadding = 9.0;
} // namespace
@interface BrowserActionsContainerView(Private)
// Returns the cursor that should be shown when hovering over the grippy based
// on |canDragLeft_| and |canDragRight_|.
- (NSCursor*)appropriateCursorForGrippy;
-// Draws the area that the user can use to resize the container. Currently, two
-// vertical "grip" bars.
-- (void)drawGrippy;
@end
@implementation BrowserActionsContainerView
@@ -46,7 +36,6 @@
@synthesize grippyPinned = grippyPinned_;
@synthesize maxWidth = maxWidth_;
@synthesize userIsResizing = userIsResizing_;
-@synthesize rightBorderShown = rightBorderShown_;
#pragma mark -
#pragma mark Overridden Class Functions
@@ -73,29 +62,6 @@
return resizable_;
}
-- (void)drawRect:(NSRect)dirtyRect {
- if (rightBorderShown_) {
- NSRect bounds = [self bounds];
- NSColor* middleColor =
- [NSColor colorWithCalibratedWhite:kRightBorderGrayscale alpha:1.0];
- NSColor* endPointColor =
- [NSColor colorWithCalibratedWhite:kRightBorderGrayscale alpha:0.0];
- scoped_nsobject<NSGradient> borderGradient([[NSGradient alloc]
- initWithColorsAndLocations:endPointColor, (CGFloat)0.0,
- middleColor, (CGFloat)0.5,
- endPointColor, (CGFloat)1.0,
- nil]);
- CGFloat xPos = bounds.origin.x + bounds.size.width - kRightBorderWidth +
- kRightBorderXOffset;
- NSRect borderRect = NSMakeRect(xPos, kLowerPadding, kRightBorderWidth,
- bounds.size.height - kUpperPadding);
- [borderGradient drawInRect:borderRect angle:90.0];
- }
-
- if (resizable_)
- [self drawGrippy];
-}
-
- (void)resetCursorRects {
[self discardCursorRects];
[self addCursorRect:grippyRect_ cursor:[self appropriateCursorForGrippy]];
@@ -215,25 +181,4 @@
return retVal;
}
-- (void)drawGrippy {
- NSRect grippyRect = NSMakeRect(0.0, kLowerPadding + kGrippyLowerPadding, 1.0,
- [self bounds].size.height - kUpperPadding - kGrippyUpperPadding);
- [[NSColor colorWithCalibratedWhite:0.7 alpha:0.5] set];
- NSRectFill(grippyRect);
-
- [[NSColor colorWithCalibratedWhite:1.0 alpha:1.0] set];
- grippyRect.origin.x += 1.0;
- NSRectFill(grippyRect);
-
- grippyRect.origin.x += 1.0;
-
- [[NSColor colorWithCalibratedWhite:0.7 alpha:0.5] set];
- grippyRect.origin.x += 1.0;
- NSRectFill(grippyRect);
-
- [[NSColor colorWithCalibratedWhite:1.0 alpha:1.0] set];
- grippyRect.origin.x += 1.0;
- NSRectFill(grippyRect);
-}
-
@end

Powered by Google App Engine
This is Rietveld 408576698