|
11 | 11 |
|
12 | 12 | static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; |
13 | 13 |
|
| 14 | +@interface SCMiniMapView () |
| 15 | + |
| 16 | +@property (nonatomic, retain) NSColor *backgroundColor; |
| 17 | + |
| 18 | +@end |
| 19 | + |
14 | 20 | @implementation SCMiniMapView |
15 | 21 |
|
16 | 22 | - (id)initWithFrame:(NSRect)frame |
@@ -60,6 +66,8 @@ - (NSTextView *)textView |
60 | 66 | if (_textView == nil) { |
61 | 67 | _textView = [[NSTextView alloc] initWithFrame:self.bounds]; |
62 | 68 | [_textView setAutoresizingMask: NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; |
| 69 | + [_textView setBackgroundColor:[NSColor clearColor]]; |
| 70 | + |
63 | 71 | [_textView.textContainer setLineFragmentPadding:0.0f]; |
64 | 72 |
|
65 | 73 | [_textView.layoutManager setDelegate:self]; |
@@ -137,7 +145,8 @@ - (void)updateTheme |
137 | 145 | } |
138 | 146 | } |
139 | 147 |
|
140 | | - [self.textView setBackgroundColor:[miniMapBackgroundColor shadowWithLevel:kDefaultShadowLevel]]; |
| 148 | + self.backgroundColor = [miniMapBackgroundColor shadowWithLevel:kDefaultShadowLevel]; |
| 149 | + [self.textView.textStorage addAttribute:NSBackgroundColorAttributeName value:self.backgroundColor range:NSMakeRange(0, self.textView.textStorage.length)]; |
141 | 150 | [self.selectionView setSelectionColor:nil]; |
142 | 151 | } |
143 | 152 |
|
@@ -165,6 +174,7 @@ - (void)updateTextView |
165 | 174 | }]; |
166 | 175 |
|
167 | 176 | [self.textView.textStorage setAttributedString:mutableAttributedString]; |
| 177 | + [self.textView.textStorage addAttribute:NSBackgroundColorAttributeName value:self.backgroundColor range:NSMakeRange(0, self.textView.textStorage.length)]; |
168 | 178 | [mutableAttributedString release]; |
169 | 179 | } |
170 | 180 |
|
|
0 commit comments