mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-02-10 18:05:16 +08:00
[macos] fix bug 78050
This commit is contained in:
@ -1872,6 +1872,9 @@
|
|||||||
@"type": [ASCThemesController isCurrentThemeDark] ? @"dark" : @"light",
|
@"type": [ASCThemesController isCurrentThemeDark] ? @"dark" : @"light",
|
||||||
@"system": mode}];
|
@"system": mode}];
|
||||||
[[ASCEditorJSVariables instance] apply];
|
[[ASCEditorJSVariables instance] apply];
|
||||||
|
|
||||||
|
json = [[NSMutableDictionary alloc] initWithDictionary: @{@"theme": [ASCThemesController actualThemeId]}];
|
||||||
|
appManager->UpdatePlugins([[json jsonString] stdwstring]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,7 @@ static NSString * const windowBackgroundColor = @"window-backg
|
|||||||
+ (NSString*)currentThemeId;
|
+ (NSString*)currentThemeId;
|
||||||
+ (BOOL)isCurrentThemeDark;
|
+ (BOOL)isCurrentThemeDark;
|
||||||
+ (NSString*)defaultThemeId:(BOOL)isdark;
|
+ (NSString*)defaultThemeId:(BOOL)isdark;
|
||||||
|
+ (NSString*)actualThemeId;
|
||||||
+ (NSColor*)color:(NSString*)name forTheme:(NSString*)theme;
|
+ (NSColor*)color:(NSString*)name forTheme:(NSString*)theme;
|
||||||
+ (NSColor*)currentThemeColor:(NSString*)name;
|
+ (NSColor*)currentThemeColor:(NSString*)name;
|
||||||
+ (BOOL)isSystemDarkMode;
|
+ (BOOL)isSystemDarkMode;
|
||||||
|
|||||||
@ -121,6 +121,13 @@
|
|||||||
return isdark ? uiThemeNight : uiThemeWhite;
|
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 {
|
+ (NSColor*)currentThemeColor:(NSString*)name {
|
||||||
return [self color:name forTheme:[self currentThemeId]];
|
return [self color:name forTheme:[self currentThemeId]];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user