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

Unified Diff: chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm

Issue 2336463002: Make the edge where BackgroundGradientView draws a divider selectable. (Closed)
Patch Set: Use NSMaxYEdge for older SDKs, un-goof rect math. Created 4 years, 3 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/browser/ui/cocoa/background_gradient_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm
index 92dd23f985a34f5e67b16ecb8617858b0119cd8e..a6f6c0df825136975f48fff0164c3407a2fbda37 100644
--- a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm
+++ b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm
@@ -16,7 +16,7 @@
// For programmatic instantiations in unit tests.
- (id)initWithFrame:(NSRect)frameRect {
if ((self = [super initWithFrame:frameRect])) {
- [self setShowsDivider:NO];
+ self.dividerEdge = NSMaxYEdge;
}
return self;
}
@@ -24,26 +24,11 @@
// For nib instantiations in production.
- (id)initWithCoder:(NSCoder*)decoder {
if ((self = [super initWithCoder:decoder])) {
- [self setShowsDivider:NO];
+ self.dividerEdge = NSMaxYEdge;
}
return self;
}
-- (NSColor*)strokeColor {
- const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
- if (!themeProvider) {
- return [NSColor blackColor];
- }
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- BOOL isActive = [[self window] isMainWindow];
- return themeProvider->GetNSColor(
- isActive ? ThemeProperties::COLOR_TOOLBAR_STROKE :
- ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE);
- }
- return themeProvider->GetNSColor(
- ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR);
-}
-
- (NSPoint)patternPhase {
// We want our backgrounds for the shelf to be phased from the upper
// left hand corner of the view. Offset it by tab height so that the
@@ -55,17 +40,10 @@
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
- // Draw top stroke
+ // Draw the top highlight
NSRect borderRect, contentRect;
NSDivideRect([self bounds], &borderRect, &contentRect, [self cr_lineWidth],
NSMaxYEdge);
- if (NSIntersectsRect(borderRect, dirtyRect)) {
- [[self strokeColor] set];
- NSRectFillUsingOperation(NSIntersectionRect(borderRect, dirtyRect),
- NSCompositeSourceOver);
- }
-
- // Draw the top highlight
borderRect.origin.y -= [self cr_lineWidth];
if (NSIntersectsRect(borderRect, dirtyRect)) {
const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
« no previous file with comments | « chrome/browser/ui/cocoa/background_gradient_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698