Use control background color for dark mode
This commit is contained in:
parent
8058f37fff
commit
14c2e70f7b
|
@ -131,13 +131,13 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
||||||
|
|
||||||
- (void)drawRect:(NSRect)dirtyRect
|
- (void)drawRect:(NSRect)dirtyRect
|
||||||
{
|
{
|
||||||
NSColor *white = [NSColor whiteColor];
|
NSColor *backgroundColor = [NSColor controlBackgroundColor];
|
||||||
NSColor *darkGray = [NSColor colorWithDeviceWhite:0.7 alpha:1.0];
|
NSColor *darkGray = [NSColor colorWithDeviceWhite:0.7 alpha:1.0];
|
||||||
NSColor *lightGray = [NSColor colorWithDeviceWhite:0.8 alpha:1.0];
|
NSColor *lightGray = [NSColor colorWithDeviceWhite:0.8 alpha:1.0];
|
||||||
|
|
||||||
NSRect bounds = [self bounds];
|
NSRect bounds = [self bounds];
|
||||||
|
|
||||||
[white setFill];
|
[backgroundColor setFill];
|
||||||
[NSBezierPath fillRect:bounds];
|
[NSBezierPath fillRect:bounds];
|
||||||
|
|
||||||
[[NSColor darkGrayColor] setStroke];
|
[[NSColor darkGrayColor] setStroke];
|
||||||
|
@ -169,7 +169,7 @@ NS_INLINE CGFloat max(CGFloat a, CGFloat b) { return a > b ? a : b; }
|
||||||
[(NSMutableDictionary *)activeCandidateAttr setObject:[NSColor selectedTextColor] forKey:NSForegroundColorAttributeName];
|
[(NSMutableDictionary *)activeCandidateAttr setObject:[NSColor selectedTextColor] forKey:NSForegroundColorAttributeName];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
[white setFill];
|
[backgroundColor setFill];
|
||||||
}
|
}
|
||||||
|
|
||||||
[NSBezierPath fillRect:candidateRect];
|
[NSBezierPath fillRect:candidateRect];
|
||||||
|
|
Loading…
Reference in New Issue