Add the ability to disable extra processing

If the user want to get full control of the Acrylic color.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2021-03-11 10:08:13 +08:00
parent 76fd19211d
commit 070e8edc52
2 changed files with 6 additions and 0 deletions

View File

@ -68,6 +68,7 @@ namespace _flh_global {
[[maybe_unused]] const char _flh_acrylic_blurEnabled_flag[] = "_FRAMELESSHELPER_BLUR_ENABLED";
[[maybe_unused]] const char _flh_acrylic_blurMode_flag[] = "_FRAMELESSHELPER_BLUR_MODE";
[[maybe_unused]] const char _flh_acrylic_gradientColor_flag[] = "_FRAMELESSHELPER_BLUR_GRADIENT_COLOR";
[[maybe_unused]] const char _flh_acrylic_disableExtraProcess[] = "_FRAMELESSHELPER_DISABLE_EXTRA_PROCESS_FOR_BLUR";
[[maybe_unused]] const char _flh_acrylic_forceEnableOfficialMSWin10AcrylicBlur_flag[] = "_FRAMELESSHELPER_FORCE_ENABLE_MSWIN10_OFFICIAL_ACRYLIC_BLUR";
[[maybe_unused]] const char _flh_acrylic_forceEnableTraditionalBlur_flag[] = "_FRAMELESSHELPER_FORCE_ENABLE_TRADITIONAL_BLUR";
[[maybe_unused]] const char _flh_acrylic_forceDisableWallpaperBlur_flag[] = "_FRAMELESSHELPER_FORCE_DISABLE_WALLPAPER_BLUR";

View File

@ -206,6 +206,11 @@ void QtAcrylicEffectHelper::paintBackground(QPainter *painter, const QRect &rect
if (!checkWindow()) {
return;
}
// TODO: should we limit it to Win32 only? Or should we do something about the
// acrylic brush instead?
if (qEnvironmentVariableIsSet(_flh_global::_flh_acrylic_disableExtraProcess)) {
return;
}
if (Utilities::shouldUseTraditionalBlur()) {
const QPainter::CompositionMode mode = painter->compositionMode();
painter->setCompositionMode(QPainter::CompositionMode_Clear);