Fixed two issues.

1. The border color on Win10 when in light theme is also #707070, not pure white.
2. The brush color of the Acrylic effect is reversed before, it is now correct.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-10-21 11:10:51 +08:00
parent f3e863e14b
commit 8c21be9e64
3 changed files with 8 additions and 7 deletions

View File

@ -216,7 +216,7 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
});
connect(ui->blurEffectCB, &QCheckBox::stateChanged, this, [this](int state) {
const bool enable = state == Qt::Checked;
QColor color = QColor(255, 255, 255, 0);
QColor color = Qt::white;
if (isGreaterThanWin10_1803() && ui->forceAcrylicCB->isChecked()) {
if (enable) {
color = QColorDialog::getColor(color,
@ -280,8 +280,7 @@ bool Widget::shouldDrawThemedBorder(const bool ignoreWindowState) const
QColor Widget::activeBorderColor() const
{
return isThemeColorEnabled() ? m_cThemeColor
: (isDarkModeEnabled() ? m_cDefaultActiveBorderColor : Qt::white);
return isThemeColorEnabled() ? m_cThemeColor : m_cDefaultActiveBorderColor;
}
QColor Widget::inactiveBorderColor() const

View File

@ -2415,9 +2415,11 @@ bool WinNativeEventFilter::setBlurEffectEnabled(void *handle,
// The gradient color must be set otherwise it'll look
// like a classic blur. Use semi-transparent gradient
// color to get better appearance.
const QColor color = gradientColor.isValid() ? gradientColor
: QColor(255, 255, 255, 0);
accentPolicy.GradientColor = color.rgba();
const QColor color = gradientColor.isValid() ? gradientColor : Qt::white;
accentPolicy.GradientColor = qRgba(color.blue(),
color.green(),
color.red(),
color.alpha());
} else {
// Enabling the Acrylic effect for Win32 windows is
// very buggy and it's a bug of Windows 10 itself so

View File

@ -144,7 +144,7 @@ public:
// On Win10 it's the Acrylic effect.
static bool setBlurEffectEnabled(void *handle /* HWND */,
const bool enabled = true,
const QColor &gradientColor = QColor(255, 255, 255, 0));
const QColor &gradientColor = Qt::white);
// Thin wrapper of DwmExtendFrameIntoClientArea().
static void updateFrameMargins(void *handle /* HWND */);