mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[macos] send theme to start page
This commit is contained in:
@ -1469,8 +1469,10 @@
|
||||
if ( !uiLang )
|
||||
uiLang = [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode];
|
||||
|
||||
NSString * uiTheme = [[NSUserDefaults standardUserDefaults] valueForKey:ASCUserUITheme];
|
||||
|
||||
NSDictionary * json_langs = @{
|
||||
@"locale": @{
|
||||
@"locale_skip": @{
|
||||
@"current": uiLang,
|
||||
@"langs": @{
|
||||
@"en": @"English",
|
||||
@ -1483,7 +1485,8 @@
|
||||
@"pt-BR": @"Português Brasileiro",
|
||||
@"zh-CN": @"中文"
|
||||
}
|
||||
}
|
||||
},
|
||||
@"uitheme": uiTheme
|
||||
};
|
||||
|
||||
NSEditorApi::CAscExecCommandJS * pCommand = new NSEditorApi::CAscExecCommandJS;
|
||||
|
||||
@ -67,6 +67,10 @@ static NSString * const kRegHelpUrl = @"kRegHelpUrl";
|
||||
static NSString * const kHelpUrl = @"kHelpUrl";
|
||||
static NSString * const kRegistrationPortalUrl = @"kRegistrationPortalUrl";
|
||||
|
||||
// UI Theme id
|
||||
static NSString * const uiThemeLight = @"theme-light";
|
||||
static NSString * const uiThemeDark = @"theme-dark";
|
||||
|
||||
// Custom schemes
|
||||
static NSString * const kSchemeApp = @"oo-office";
|
||||
|
||||
@ -84,6 +88,7 @@ static NSString * const ASCUserSettingsNameUserInfo = @"asc_user_info";
|
||||
static NSString * const ASCUserLastSavePath = @"asc_save_path";
|
||||
static NSString * const ASCUserNameApp = @"asc_user_name_app";
|
||||
static NSString * const ASCUserUILanguage = @"asc_user_ui_lang";
|
||||
static NSString * const ASCUserUITheme = @"asc_user_ui_theme";
|
||||
|
||||
// Application event names
|
||||
static NSString * const ASCEventNameMainWindowSetFrame = @"UI_mainWindowSetFrame";
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
#import "ASCHelper.h"
|
||||
#import "ASCDocSignController.h"
|
||||
#import "ASCExternalController.h"
|
||||
#import "NSApplication+Extensions.h"
|
||||
|
||||
CAscApplicationManager * createASCApplicationManager() {
|
||||
return new ASCApplicationManager();
|
||||
@ -96,6 +97,15 @@ int main(int argc, const char * argv[]) {
|
||||
[params addObject:[NSString stringWithFormat:@"username=%@", fullName]];
|
||||
}
|
||||
|
||||
// setup ui theme
|
||||
NSString * uiTheme = [[NSUserDefaults standardUserDefaults] valueForKey:ASCUserUITheme];
|
||||
if ( !uiTheme ) {
|
||||
uiTheme = [NSApplication isSystemDarkMode] ? uiThemeDark : uiThemeLight;
|
||||
[[NSUserDefaults standardUserDefaults] setObject:uiTheme forKey:ASCUserUITheme];
|
||||
}
|
||||
|
||||
[params addObject:[NSString stringWithFormat:@"uitheme=%@", uiTheme]];
|
||||
|
||||
std::wstring wLocale = [[params componentsJoinedByString:@"&"] stdwstring];
|
||||
appManager->InitAdditionalEditorParams(wLocale);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user