move static_assert to cpp source files
To speed up compilation time. Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
f15ca8daf0
commit
87da6cb5da
|
@ -278,7 +278,7 @@ Q_ENUM_NS(SystemButtonType)
|
|||
#ifdef Q_OS_WINDOWS
|
||||
enum class DwmColorizationArea
|
||||
{
|
||||
None_ = 0, // Avoid name conflicts with X11 headers.
|
||||
None = 0,
|
||||
StartMenu_TaskBar_ActionCenter = 1,
|
||||
TitleBar_WindowBorder = 2,
|
||||
All = 3
|
||||
|
@ -579,7 +579,6 @@ struct SystemParameters
|
|||
{10, 0, 22000}, // Windows 11 Version 21H2 (21H2)
|
||||
{10, 0, 22621}, // Windows 11 Version 22H2 (22H2)
|
||||
};
|
||||
static_assert(std::size(WindowsVersions) == (static_cast<int>(WindowsVersion::Latest) + 1));
|
||||
#endif // Q_OS_WINDOWS
|
||||
|
||||
struct VersionInfo
|
||||
|
|
|
@ -66,7 +66,7 @@ private:
|
|||
Global::SystemTheme m_systemTheme = Global::SystemTheme::Unknown;
|
||||
QColor m_accentColor = {};
|
||||
#ifdef Q_OS_WINDOWS
|
||||
Global::DwmColorizationArea m_colorizationArea = Global::DwmColorizationArea::None_;
|
||||
Global::DwmColorizationArea m_colorizationArea = Global::DwmColorizationArea::None;
|
||||
#endif
|
||||
QString m_wallpaper = {};
|
||||
Global::WallpaperAspectStyle m_wallpaperAspectStyle = Global::WallpaperAspectStyle::Fill;
|
||||
|
|
|
@ -116,7 +116,7 @@ public:
|
|||
#ifdef Q_OS_WINDOWS
|
||||
enum class DwmColorizationArea
|
||||
{
|
||||
FRAMELESSHELPER_QUICK_ENUM_VALUE(DwmColorizationArea, None_)
|
||||
FRAMELESSHELPER_QUICK_ENUM_VALUE(DwmColorizationArea, None)
|
||||
FRAMELESSHELPER_QUICK_ENUM_VALUE(DwmColorizationArea, StartMenu_TaskBar_ActionCenter)
|
||||
FRAMELESSHELPER_QUICK_ENUM_VALUE(DwmColorizationArea, TitleBar_WindowBorder)
|
||||
FRAMELESSHELPER_QUICK_ENUM_VALUE(DwmColorizationArea, All)
|
||||
|
|
|
@ -78,6 +78,10 @@ Q_LOGGING_CATEGORY(lcCoreGlobal, "wangwenx190.framelesshelper.core.global")
|
|||
|
||||
using namespace Global;
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
static_assert(std::size(WindowsVersions) == (static_cast<int>(WindowsVersion::Latest) + 1));
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
[[maybe_unused]] static constexpr const char QT_QPA_ENV_VAR[] = "QT_QPA_PLATFORM";
|
||||
FRAMELESSHELPER_BYTEARRAY_CONSTANT(xcb)
|
||||
|
|
|
@ -853,7 +853,7 @@ DwmColorizationArea Utils::getDwmColorizationArea()
|
|||
{
|
||||
// It's a Win10 only feature. (TO BE VERIFIED)
|
||||
if (!WindowsVersionHelper::isWin10OrGreater()) {
|
||||
return DwmColorizationArea::None_;
|
||||
return DwmColorizationArea::None;
|
||||
}
|
||||
const RegistryKey themeRegistry(RegistryRootKey::CurrentUser, personalizeRegistryKey());
|
||||
const DWORD themeValue = themeRegistry.isValid() ? themeRegistry.value<DWORD>(qDwmColorKeyName).value_or(0) : 0;
|
||||
|
@ -868,7 +868,7 @@ DwmColorizationArea Utils::getDwmColorizationArea()
|
|||
} else if (dwm) {
|
||||
return DwmColorizationArea::TitleBar_WindowBorder;
|
||||
}
|
||||
return DwmColorizationArea::None_;
|
||||
return DwmColorizationArea::None;
|
||||
}
|
||||
|
||||
void Utils::showSystemMenu(const WId windowId, const QPoint &pos, const bool selectFirstEntry,
|
||||
|
|
Loading…
Reference in New Issue