| | |
| | | return true; |
| | | |
| | | case WM_SETTINGCHANGE: { |
| | | if (!msg->wParam && msg->lParam && |
| | | std::wcscmp(reinterpret_cast<LPCWSTR>(msg->lParam), L"ImmersiveColorSet") == |
| | | 0) { |
| | | if (isImmersiveColorSetChange(msg->wParam, msg->lParam)) { |
| | | return true; |
| | | } |
| | | break; |
| | |
| | | } |
| | | }(); |
| | | for (auto &&ap : std::as_const(*g_styleAgentSet())) { |
| | | if (ap->systemTheme != theme) { |
| | | ap->systemTheme = theme; |
| | | ap->notifyThemeChanged(theme); |
| | | } |
| | | ap->notifyThemeChanged(theme); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | SystemSettingEventFilter *SystemSettingEventFilter::instance = nullptr; |
| | | |
| | | void StyleAgentPrivate::init() { |
| | | void StyleAgentPrivate::setupSystemThemeHook() { |
| | | if (isHighContrastModeEnabled()) { |
| | | systemTheme = StyleAgent::HighContrast; |
| | | } else if (isDarkThemeActive()) { |
| | |
| | | } else { |
| | | systemTheme = StyleAgent::Light; |
| | | } |
| | | } |
| | | |
| | | void StyleAgentPrivate::setupSystemThemeHook() { |
| | | g_styleAgentSet->insert(this); |
| | | SystemSettingEventFilter::install(); |
| | | } |