diff --git a/Frameworks/OakTextView/src/OakDocumentView.h b/Frameworks/OakTextView/src/OakDocumentView.h index 4239f6f0..72cf87cc 100644 --- a/Frameworks/OakTextView/src/OakDocumentView.h +++ b/Frameworks/OakTextView/src/OakDocumentView.h @@ -16,6 +16,8 @@ PUBLIC @interface OakDocumentView : NSView gutter_styles(); - self.gutterDividerColor = [NSColor tmColorWithCGColor:styles.divider]; gutterView.foregroundColor = [NSColor tmColorWithCGColor:styles.foreground]; gutterView.backgroundColor = [NSColor tmColorWithCGColor:styles.background]; @@ -359,17 +365,16 @@ private: gutterView.selectionIconHoverColor = [NSColor tmColorWithCGColor:styles.selectionIconsHover]; gutterView.selectionIconPressedColor = [NSColor tmColorWithCGColor:styles.selectionIconsPressed]; gutterView.selectionBorderColor = [NSColor tmColorWithCGColor:styles.selectionBorder]; + gutterScrollView.backgroundColor = gutterView.backgroundColor; + gutterDividerView.borderColor = [NSColor tmColorWithCGColor:styles.divider]; - gutterScrollView.backgroundColor = gutterView.backgroundColor; - - [self setNeedsDisplayInRect:[self gutterDividerRect]]; [gutterView setNeedsDisplay:YES]; } } - (BOOL)isOpaque { - return YES; // this is not entirely true as this view only draws the separator between gutter and text view, but we know all the other areas are completely drawn by subviews, so we return ‘YES’ to avoid our parent view (window) having to fill the entire area each time the separator needs to be redrawn + return YES; } - (IBAction)toggleLineNumbers:(id)sender @@ -420,6 +425,7 @@ private: } [gutterScrollView setFrame:NSMakeRect(0, y, gutterWidth - 1, docHeight)]; + [gutterDividerView setFrame:NSMakeRect(gutterWidth - 1, y, 1, docHeight)]; [textScrollView setFrame:NSMakeRect(gutterWidth, y, NSWidth(textScrollView.frame), docHeight)]; y += docHeight; @@ -478,10 +484,6 @@ private: [[NSColor grayColor] set]; NSRectFill(NSIntersectionRect(NSMakeRect(NSMinX(aRect), NSHeight(self.frame) - height, NSWidth(aRect), 1), aRect)); } - - // Draw the border between gutter and text views - [gutterDividerColor set]; - NSRectFill(NSIntersectionRect([self gutterDividerRect], aRect)); } // ======================