[macos] fix bug 78050

This commit is contained in:
maxkadushkin
2025-11-12 13:53:11 +03:00
parent 45a1a3924e
commit 42b57d91c9
3 changed files with 11 additions and 0 deletions

View File

@ -1872,6 +1872,9 @@
@"type": [ASCThemesController isCurrentThemeDark] ? @"dark" : @"light",
@"system": mode}];
[[ASCEditorJSVariables instance] apply];
json = [[NSMutableDictionary alloc] initWithDictionary: @{@"theme": [ASCThemesController actualThemeId]}];
appManager->UpdatePlugins([[json jsonString] stdwstring]);
}
}

View File

@ -60,6 +60,7 @@ static NSString * const windowBackgroundColor = @"window-backg
+ (NSString*)currentThemeId;
+ (BOOL)isCurrentThemeDark;
+ (NSString*)defaultThemeId:(BOOL)isdark;
+ (NSString*)actualThemeId;
+ (NSColor*)color:(NSString*)name forTheme:(NSString*)theme;
+ (NSColor*)currentThemeColor:(NSString*)name;
+ (BOOL)isSystemDarkMode;

View File

@ -121,6 +121,13 @@
return isdark ? uiThemeNight : uiThemeWhite;
}
+ (NSString*)actualThemeId {
NSString * theme = [self currentThemeId];
if ([uiThemeSystem isEqualToString:theme]) {
return [self defaultThemeId:[self isCurrentThemeDark]];
} else return theme;
}
+ (NSColor*)currentThemeColor:(NSString*)name {
return [self color:name forTheme:[self currentThemeId]];
}