1515#include < timeapi.h>
1616
1717#include < QWKCore/qwindowkit_windows.h>
18-
1918#include < QtCore/private/qsystemlibrary_p.h>
20- #include < QtCore/private/qwinregistry_p.h>
2119
2220#include < QtGui/QGuiApplication>
2321#include < QtGui/QStyleHints>
@@ -132,12 +130,14 @@ namespace QWK {
132130 };
133131 using PWINDOWCOMPOSITIONATTRIBDATA = WINDOWCOMPOSITIONATTRIBDATA *;
134132
135- enum PREFERRED_APP_MODE
136- {
137- PAM_DEFAULT = 0 , // Default behavior on systems before Win10 1809. It indicates the application doesn't support dark mode at all.
138- PAM_AUTO = 1 , // Available since Win10 1809, let system decide whether to enable dark mode or not.
139- PAM_DARK = 2 , // Available since Win10 1903, force dark mode regardless of the system theme.
140- PAM_LIGHT = 3 , // Available since Win10 1903, force light mode regardless of the system theme.
133+ enum PREFERRED_APP_MODE {
134+ PAM_DEFAULT = 0 , // Default behavior on systems before Win10 1809. It indicates the
135+ // application doesn't support dark mode at all.
136+ PAM_AUTO =
137+ 1 , // Available since Win10 1809, let system decide whether to enable dark mode or not.
138+ PAM_DARK = 2 , // Available since Win10 1903, force dark mode regardless of the system theme.
139+ PAM_LIGHT =
140+ 3 , // Available since Win10 1903, force light mode regardless of the system theme.
141141 PAM_MAX = 4
142142 };
143143
@@ -230,7 +230,7 @@ namespace QWK {
230230
231231 ~DynamicApis () = default ;
232232
233- Q_DISABLE_COPY_MOVE (DynamicApis)
233+ Q_DISABLE_COPY (DynamicApis)
234234 };
235235
236236 }
@@ -337,7 +337,7 @@ namespace QWK {
337337 }
338338
339339 static inline bool isWindowFrameBorderColorized () {
340- QWinRegistryKey registry (HKEY_CURRENT_USER, LR"( Software\Microsoft\Windows\DWM)" );
340+ WindowsRegistryKey registry (HKEY_CURRENT_USER, LR"( Software\Microsoft\Windows\DWM)" );
341341 if (!registry.isValid ()) {
342342 return false ;
343343 }
@@ -359,7 +359,7 @@ namespace QWK {
359359#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
360360 return QGuiApplication::styleHints ()->colorScheme () == Qt::ColorScheme::Dark;
361361#else
362- QWinRegistryKey registry (
362+ WindowsRegistryKey registry (
363363 HKEY_CURRENT_USER, LR"( Software\Microsoft\Windows\CurrentVersion\Themes\Personalize)" );
364364 if (!registry.isValid ()) {
365365 return false ;
@@ -390,7 +390,7 @@ namespace QWK {
390390#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
391391 return QGuiApplication::palette ().color (QPalette::Accent);
392392#else
393- QWinRegistryKey registry (HKEY_CURRENT_USER, LR"( Software\Microsoft\Windows\DWM)" );
393+ WindowsRegistryKey registry (HKEY_CURRENT_USER, LR"( Software\Microsoft\Windows\DWM)" );
394394 if (!registry.isValid ()) {
395395 return {};
396396 }
0 commit comments