From 61cb997e4e9ebf50bcff835841fbd1ecc9499e49 Mon Sep 17 00:00:00 2001
From: Zhao Yuhang <2546789017@qq.com>
Date: 周五, 22 12月 2023 21:14:31 +0800
Subject: [PATCH] add themechange notify on win

---
 src/core/shared/qwkwindowsextra_p.h |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/core/shared/qwkwindowsextra_p.h b/src/core/shared/qwkwindowsextra_p.h
index 850f0a2..d934c07 100644
--- a/src/core/shared/qwkwindowsextra_p.h
+++ b/src/core/shared/qwkwindowsextra_p.h
@@ -16,11 +16,11 @@
 
 #include <QWKCore/qwindowkit_windows.h>
 
-#include <QtGui/QStyleHints>
-#include <QtGui/QPalette>
-
 #include <QtCore/private/qsystemlibrary_p.h>
 #include <QtCore/private/qwinregistry_p.h>
+
+#include <QtGui/QStyleHints>
+#include <QtGui/QPalette>
 
 // Don't include this header in any header files.
 
@@ -327,6 +327,13 @@
         return value.first;
     }
 
+    static inline bool isHighContrastModeEnabled() {
+        HIGHCONTRASTW hc{};
+        hc.cbSize = sizeof(hc);
+        ::SystemParametersInfoW(SPI_GETHIGHCONTRAST, sizeof(hc), &hc, FALSE);
+        return (hc.dwFlags & HCF_HIGHCONTRASTON);
+    }
+
     static inline bool isDarkThemeActive() {
 #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
         return QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark;

--
Gitblit v1.9.1