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

Unified Diff: chrome/browser/ui/cocoa/background_gradient_view.mm

Issue 2336463002: Make the edge where BackgroundGradientView draws a divider selectable. (Closed)
Patch Set: Put back the highlight above the download shelf (though it'll go away w/ MD) 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
Index: chrome/browser/ui/cocoa/background_gradient_view.mm
diff --git a/chrome/browser/ui/cocoa/background_gradient_view.mm b/chrome/browser/ui/cocoa/background_gradient_view.mm
index 6458533dbc51ed8db54c04fa93f229d46d37d96d..9eadb70752544a14ef7c061d419dee4890049ff3 100644
--- a/chrome/browser/ui/cocoa/background_gradient_view.mm
+++ b/chrome/browser/ui/cocoa/background_gradient_view.mm
@@ -12,14 +12,10 @@
#import "ui/base/cocoa/nsview_additions.h"
#include "ui/base/material_design/material_design_controller.h"
-@interface BackgroundGradientView (Private)
-- (void)commonInit;
-- (NSColor*)backgroundImageColor;
-@end
-
@implementation BackgroundGradientView
@synthesize showsDivider = showsDivider_;
+@synthesize dividerEdge = dividerEdge_;
- (id)initWithFrame:(NSRect)frameRect {
if ((self = [super initWithFrame:frameRect])) {
@@ -37,6 +33,7 @@
- (void)commonInit {
showsDivider_ = YES;
+ dividerEdge_ = NSMinYEdge;
}
- (void)setShowsDivider:(BOOL)show {
@@ -46,6 +43,13 @@
[self setNeedsDisplay:YES];
}
+- (void)setDividerEdge:(NSRectEdge)dividerEdge {
+ if (dividerEdge_ == dividerEdge)
+ return;
+ dividerEdge_ = dividerEdge;
+ [self setNeedsDisplay:YES];
+}
+
- (NSPoint)patternPhase {
return [[self window]
themeImagePositionForAlignment:THEME_IMAGE_ALIGN_WITH_TAB_STRIP];
@@ -68,10 +72,10 @@
NSRectFillUsingOperation(dirtyRect, NSCompositeSourceOver);
if (showsDivider_) {
- // Draw bottom stroke
+ // Draw stroke
NSRect borderRect, contentRect;
NSDivideRect([self bounds], &borderRect, &contentRect, [self cr_lineWidth],
- NSMinYEdge);
+ dividerEdge_);
if (NSIntersectsRect(borderRect, dirtyRect)) {
[[self strokeColor] set];
NSRectFillUsingOperation(NSIntersectionRect(borderRect, dirtyRect),

Powered by Google App Engine
This is Rietveld 408576698