forked from github_mirror/framelesshelper
Minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
b51c6ce564
commit
bc9edaf78a
|
@ -430,6 +430,20 @@ static inline bool forceEnableOfficialMSWin10AcrylicBlur()
|
|||
return qEnvironmentVariableIsSet(_flh_global::_flh_acrylic_forceOfficialMSWin10Blur_flag);
|
||||
}
|
||||
|
||||
static inline bool shouldUseOfficialMSWin10AcrylicBlur()
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
|
||||
const QOperatingSystemVersion currentVersion = QOperatingSystemVersion::current();
|
||||
if (currentVersion > QOperatingSystemVersion::Windows10) {
|
||||
return true;
|
||||
}
|
||||
return ((currentVersion.microVersion() >= 16190) && (currentVersion.microVersion() < 18362));
|
||||
#else
|
||||
// TODO
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Utilities::isMSWin10AcrylicEffectAvailable()
|
||||
{
|
||||
if (!isWin10OrGreater()) {
|
||||
|
@ -442,16 +456,7 @@ bool Utilities::isMSWin10AcrylicEffectAvailable()
|
|||
if (forceEnableOfficialMSWin10AcrylicBlur()) {
|
||||
return true;
|
||||
}
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
|
||||
const QOperatingSystemVersion currentVersion = QOperatingSystemVersion::current();
|
||||
if (currentVersion > QOperatingSystemVersion::Windows10) {
|
||||
return true;
|
||||
}
|
||||
return ((currentVersion.microVersion() >= 16190) && (currentVersion.microVersion() < 18362));
|
||||
#else
|
||||
// TODO
|
||||
return false;
|
||||
#endif
|
||||
return shouldUseOfficialMSWin10AcrylicBlur();
|
||||
}
|
||||
|
||||
QWindow *Utilities::findWindow(const WId winId)
|
||||
|
@ -471,7 +476,7 @@ QWindow *Utilities::findWindow(const WId winId)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
static inline bool shouldUseDwmBlur()
|
||||
static inline bool shouldUseTraditionalDwmBlur()
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
|
||||
return Utilities::isWin10OrGreater() || (QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite);
|
||||
|
@ -483,7 +488,7 @@ static inline bool shouldUseDwmBlur()
|
|||
|
||||
bool Utilities::isAcrylicEffectSupported()
|
||||
{
|
||||
if (forceEnableDwmBlur() || forceDisableWallpaperBlur()/* || shouldUseDwmBlur()*/) {
|
||||
if ((forceEnableDwmBlur() || forceDisableWallpaperBlur()) && shouldUseTraditionalDwmBlur()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -537,5 +537,8 @@ QColor Utilities::getNativeWindowFrameColor(const bool isActive)
|
|||
if (!isActive) {
|
||||
return Qt::darkGray;
|
||||
}
|
||||
return (isWin10OrGreater() && isColorizationEnabled()) ? getColorizationColor() : (isDarkThemeEnabled() ? Qt::white : Qt::black);
|
||||
if (!isWin10OrGreater()) {
|
||||
return Qt::black;
|
||||
}
|
||||
return isColorizationEnabled() ? getColorizationColor() : (isDarkThemeEnabled() ? Qt::white : Qt::black);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue