Skip to content

Commit 7e8aaef

Browse files
committed
Render commit list dots dark if Mojave dark-mode
1 parent 7da571b commit 7e8aaef

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Classes/Views/PBGitRevisionCell.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ - (BOOL) isCurrentCommit
113113
return [currentOID isEqual:thisOID];
114114
}
115115

116+
static BOOL isDarkMode() {
117+
return [[[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"] isEqualToString:@"Dark"];
118+
}
119+
116120
- (void) drawCircleInRect: (NSRect) r
117121
{
118122
long c = cellInfo.position;
@@ -130,7 +134,11 @@ - (void) drawCircleInRect: (NSRect) r
130134
[shadow setShadowBlurRadius:2.0f];
131135
[shadow set];
132136
}
133-
[[NSColor blackColor] set];
137+
if (isDarkMode()) {
138+
[[NSColor whiteColor] set];
139+
} else {
140+
[[NSColor blackColor] set];
141+
}
134142
[path fill];
135143
if (ENABLE_SHADOW && false) {
136144
[NSGraphicsContext restoreGraphicsState];
@@ -141,6 +149,8 @@ - (void) drawCircleInRect: (NSRect) r
141149

142150
if ( [self isCurrentCommit ] ) {
143151
[[NSColor colorWithCalibratedRed: 0Xfc/256.0 green:0Xa6/256.0 blue: 0X4f/256.0 alpha: 1.0] set];
152+
} else if (isDarkMode()) {
153+
[[NSColor blackColor] set];
144154
} else {
145155
[[NSColor whiteColor] set];
146156
}

0 commit comments

Comments
 (0)