From 02d1cd1ec0f544335ca1b31546737868a675439f Mon Sep 17 00:00:00 2001 From: Zhao Yuhang <2546789017@qq.com> Date: 周六, 23 12月 2023 22:36:06 +0800 Subject: [PATCH] fix theme notify --- src/core/style/styleagent_win.cpp | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/core/style/styleagent_win.cpp b/src/core/style/styleagent_win.cpp index 663b632..c4e4e96 100644 --- a/src/core/style/styleagent_win.cpp +++ b/src/core/style/styleagent_win.cpp @@ -55,10 +55,7 @@ } }(); for (auto &&ap : std::as_const(*g_styleAgentSet())) { - if (ap->systemTheme != theme) { - ap->systemTheme = theme; - ap->notifyThemeChanged(theme); - } + ap->notifyThemeChanged(theme); } } @@ -85,7 +82,7 @@ SystemSettingEventFilter *SystemSettingEventFilter::instance = nullptr; - void StyleAgentPrivate::init() { + void StyleAgentPrivate::setupSystemThemeHook() { if (isHighContrastModeEnabled()) { systemTheme = StyleAgent::HighContrast; } else if (isDarkThemeActive()) { @@ -93,9 +90,7 @@ } else { systemTheme = StyleAgent::Light; } - } - void StyleAgentPrivate::setupSystemThemeHook() { g_styleAgentSet->insert(this); SystemSettingEventFilter::install(); } -- Gitblit v1.9.1