mirror of
https://github.com/electron/electron.git
synced 2026-01-28 08:48:14 -05:00
fix: About Panel credits should be dark mode aware (#21880)
This commit is contained in:
@@ -377,11 +377,18 @@ void Browser::ShowAboutPanel() {
|
||||
NSDictionary* options = DictionaryValueToNSDictionary(about_panel_options_);
|
||||
|
||||
// Credits must be a NSAttributedString instead of NSString
|
||||
id credits = options[@"Credits"];
|
||||
NSString* credits = (NSString*)options[@"Credits"];
|
||||
if (credits != nil) {
|
||||
NSMutableDictionary* mutable_options = [options mutableCopy];
|
||||
mutable_options[@"Credits"] = [[[NSAttributedString alloc]
|
||||
initWithString:(NSString*)credits] autorelease];
|
||||
base::scoped_nsobject<NSMutableDictionary> mutable_options(
|
||||
[options mutableCopy]);
|
||||
base::scoped_nsobject<NSAttributedString> creditString(
|
||||
[[NSAttributedString alloc]
|
||||
initWithString:credits
|
||||
attributes:@{
|
||||
NSForegroundColorAttributeName : [NSColor textColor]
|
||||
}]);
|
||||
|
||||
[mutable_options setValue:creditString forKey:@"Credits"];
|
||||
options = [NSDictionary dictionaryWithDictionary:mutable_options];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user