forked from github_mirror/framelesshelper
allow user force use system blur
Signed-off-by: Yuhang Zhao <zhaoyuhang@rankyee.com>
This commit is contained in:
parent
9e208bb77c
commit
b5c9f85f62
|
@ -269,7 +269,8 @@ enum class Option
|
||||||
CenterWindowBeforeShow = 5,
|
CenterWindowBeforeShow = 5,
|
||||||
EnableBlurBehindWindow = 6,
|
EnableBlurBehindWindow = 6,
|
||||||
ForceNonNativeBackgroundBlur = 7,
|
ForceNonNativeBackgroundBlur = 7,
|
||||||
DisableLazyInitializationForMicaMaterial = 8
|
DisableLazyInitializationForMicaMaterial = 8,
|
||||||
|
ForceNativeBackgroundBlur = 9
|
||||||
};
|
};
|
||||||
Q_ENUM_NS(Option)
|
Q_ENUM_NS(Option)
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,9 @@ static const struct
|
||||||
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_FORCE_NON_NATIVE_BACKGROUND_BLUR"),
|
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_FORCE_NON_NATIVE_BACKGROUND_BLUR"),
|
||||||
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/ForceNonNativeBackgroundBlur")},
|
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/ForceNonNativeBackgroundBlur")},
|
||||||
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_DISABLE_LAZY_INITIALIZATION_FOR_MICA_MATERIAL"),
|
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_DISABLE_LAZY_INITIALIZATION_FOR_MICA_MATERIAL"),
|
||||||
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/DisableLazyInitializationForMicaMaterial")}
|
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/DisableLazyInitializationForMicaMaterial")},
|
||||||
|
{FRAMELESSHELPER_BYTEARRAY_LITERAL("FRAMELESSHELPER_FORCE_NATIVE_BACKGROUND_BLUR"),
|
||||||
|
FRAMELESSHELPER_BYTEARRAY_LITERAL("Options/ForceNativeBackgroundBlur")}
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr const auto OptionCount = std::size(OptionsTable);
|
static constexpr const auto OptionCount = std::size(OptionsTable);
|
||||||
|
@ -107,6 +109,12 @@ static inline void warnInappropriateOptions()
|
||||||
WARNING << "Option::DisableWindowsSnapLayout is only available on Windows.";
|
WARNING << "Option::DisableWindowsSnapLayout is only available on Windows.";
|
||||||
}
|
}
|
||||||
#endif // Q_OS_WINDOWS
|
#endif // Q_OS_WINDOWS
|
||||||
|
if (cfg->isSet(Option::ForceHideWindowFrameBorder) && cfg->isSet(Option::ForceShowWindowFrameBorder)) {
|
||||||
|
WARNING << "Option::ForceHideWindowFrameBorder and Option::ForceShowWindowFrameBorder can't be both enabled.";
|
||||||
|
}
|
||||||
|
if (cfg->isSet(Option::ForceNonNativeBackgroundBlur) && cfg->isSet(Option::ForceNativeBackgroundBlur)) {
|
||||||
|
WARNING << "Option::ForceNonNativeBackgroundBlur and Option::ForceNativeBackgroundBlur can't be both enabled.";
|
||||||
|
}
|
||||||
if (cfg->isSet(Option::WindowUseRoundCorners)) {
|
if (cfg->isSet(Option::WindowUseRoundCorners)) {
|
||||||
WARNING << "Option::WindowUseRoundCorners has not been implemented yet.";
|
WARNING << "Option::WindowUseRoundCorners has not been implemented yet.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,6 +530,9 @@ WallpaperAspectStyle Utils::getWallpaperAspectStyle()
|
||||||
bool Utils::isBlurBehindWindowSupported()
|
bool Utils::isBlurBehindWindowSupported()
|
||||||
{
|
{
|
||||||
static const auto result = []() -> bool {
|
static const auto result = []() -> bool {
|
||||||
|
if (FramelessConfig::instance()->isSet(Option::ForceNativeBackgroundBlur)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (FramelessConfig::instance()->isSet(Option::ForceNonNativeBackgroundBlur)) {
|
if (FramelessConfig::instance()->isSet(Option::ForceNonNativeBackgroundBlur)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1968,6 +1968,9 @@ WallpaperAspectStyle Utils::getWallpaperAspectStyle()
|
||||||
bool Utils::isBlurBehindWindowSupported()
|
bool Utils::isBlurBehindWindowSupported()
|
||||||
{
|
{
|
||||||
static const auto result = []() -> bool {
|
static const auto result = []() -> bool {
|
||||||
|
if (FramelessConfig::instance()->isSet(Option::ForceNativeBackgroundBlur)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (FramelessConfig::instance()->isSet(Option::ForceNonNativeBackgroundBlur)) {
|
if (FramelessConfig::instance()->isSet(Option::ForceNonNativeBackgroundBlur)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue