fix: About Panel credits should be dark mode aware (#21880)
This commit is contained in:
parent
5d1a9c0cbb
commit
55ccca922d
2 changed files with 14 additions and 6 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue