From 928f941c4f4b1b95fed9e5bbffacd16b22a8b5b9 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Mon, 15 Oct 2018 18:59:42 +0200 Subject: [PATCH] Improve the exception text in dark mode. --- Classes/SBApplication.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/SBApplication.m b/Classes/SBApplication.m index d27314a..46bea75 100644 --- a/Classes/SBApplication.m +++ b/Classes/SBApplication.m @@ -16,13 +16,16 @@ static void CrashMyApplication() - (NSAttributedString *)_formattedExceptionBacktrace:(NSArray *)backtrace { NSMutableAttributedString *result = [[NSMutableAttributedString alloc] init]; + NSDictionary *textAttributes = @{NSForegroundColorAttributeName: NSColor.textColor, + NSFontAttributeName: [NSFont fontWithName:@"Monaco" size:10]}; + for (__strong NSString *s in backtrace) { s = [s stringByAppendingString:@"\n"]; NSAttributedString *attrS = [[NSAttributedString alloc] initWithString:s]; [result appendAttributedString:attrS]; } - [result addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Monaco" size:10] range:NSMakeRange(0, result.length)]; + [result addAttributes:textAttributes range:NSMakeRange(0, result.length)]; return result; }