Merge pull request #1079 from ONLYOFFICE/feature/bug-64448

Feature/bug 64448
This commit is contained in:
Maxim Kadushkin
2023-12-12 19:17:39 +03:00
committed by GitHub

View File

@ -346,8 +346,16 @@ bool CWindowPlatform::nativeEvent(const QByteArray &eventType, void *message, lo
bool _changed_theme_dark = _reg.value("AppsUseLightTheme", 1).toInt() == 0;
if (_changed_theme_dark != AscAppManager::themes().isSystemSchemeDark()) {
AscAppManager::themes().onSystemDarkColorScheme(_changed_theme_dark);
qDebug() << "system theme changed";
NSEditorApi::CAscCefMenuEvent * ns_event = new NSEditorApi::CAscCefMenuEvent(ASC_MENU_EVENT_TYPE_CEF_EXECUTE_COMMAND);
NSEditorApi::CAscExecCommand * pData = new NSEditorApi::CAscExecCommand;
pData->put_Command(L"system:changed");
QJsonObject _json_obj{{"colorscheme", _changed_theme_dark ? "dark" : "light"}};
pData->put_Param(Utils::stringifyJson(_json_obj).toStdWString());
ns_event->m_pData = pData;
ns_event->m_nSenderId = 0;
AscAppManager::getInstance().OnEvent(ns_event);
}
}
}