diff --git a/baRSS/Helper/DrawImage.h b/baRSS/Helper/DrawImage.h index 9fe66a5..64af52e 100644 --- a/baRSS/Helper/DrawImage.h +++ b/baRSS/Helper/DrawImage.h @@ -3,6 +3,7 @@ /// Draw separator line in @c NSOutlineView IB_DESIGNABLE @interface DrawSeparator : NSView +@property (assign) BOOL invert; @end diff --git a/baRSS/Helper/DrawImage.m b/baRSS/Helper/DrawImage.m index 2417700..d9535b7 100644 --- a/baRSS/Helper/DrawImage.m +++ b/baRSS/Helper/DrawImage.m @@ -7,7 +7,8 @@ @implementation DrawSeparator - (void)drawRect:(NSRect)r { NSColor *color = [NSColor darkGrayColor]; - NSGradient *grdnt = [[NSGradient alloc] initWithStartingColor:color endingColor:[color colorWithAlphaComponent:0.0]]; + NSColor *transparent = [color colorWithAlphaComponent:0.0]; + NSGradient *grdnt = [[NSGradient alloc] initWithStartingColor:self.invert ? transparent : color endingColor:self.invert ? color : transparent]; NSRect separatorRect = NSMakeRect(1, NSMidY(self.bounds) - 1, NSWidth(self.bounds) - 2, 2); NSBezierPath *rounded = [NSBezierPath bezierPathWithRoundedRect:separatorRect xRadius:1 yRadius:1]; [grdnt drawInBezierPath:rounded angle:0];