File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed
Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ - (void)updateTheme
138138 }
139139
140140 [self .textView setBackgroundColor: [miniMapBackgroundColor shadowWithLevel: kDefaultShadowLevel ]];
141- [self .selectionView setNeedsDisplay: YES ];
141+ [self .selectionView setSelectionColor: nil ];
142142}
143143
144144- (void )updateTextView
Original file line number Diff line number Diff line change 1010
1111@interface SCSelectionView : NSView
1212
13+ @property (nonatomic , retain ) NSColor *selectionColor;
1314@property (nonatomic , assign ) BOOL shouldInverseColors;
1415
1516@end
Original file line number Diff line number Diff line change 88
99#import " SCSelectionView.h"
1010
11- @interface SCSelectionView ()
12-
13- @property (nonatomic , retain ) NSColor *selectionColor;
14-
15- @end
16-
1711@implementation SCSelectionView
12+ @synthesize selectionColor = _selectionColor;
1813
1914- (void )dealloc
2015{
@@ -28,14 +23,6 @@ - (void)drawRect:(NSRect)dirtyRect
2823 NSRectFill (dirtyRect);
2924}
3025
31- - (void )setNeedsDisplay : (BOOL )flag
32- {
33- if (self.needsDisplay == flag) return ;
34-
35- [self setSelectionColor: nil ];
36- [super setNeedsDisplay: flag];
37- }
38-
3926- (NSColor *)selectionColor
4027{
4128 if (_selectionColor == nil ) {
@@ -70,6 +57,14 @@ - (NSColor *)selectionColor
7057 return _selectionColor;
7158}
7259
60+ - (void )setSelectionColor : (NSColor *)selectionColor
61+ {
62+ if ([_selectionColor isEqual: selectionColor]) return ;
63+
64+ _selectionColor = selectionColor;
65+ [self setNeedsDisplay: YES ];
66+ }
67+
7368- (void )setShouldInverseColors : (BOOL )shouldInverseColors
7469{
7570 if (_shouldInverseColors == shouldInverseColors) {
You can’t perform that action at this time.
0 commit comments