diff --git a/examples/Win32Demo/widget.cpp b/examples/Win32Demo/widget.cpp index a0d21f4..100b99c 100644 --- a/examples/Win32Demo/widget.cpp +++ b/examples/Win32Demo/widget.cpp @@ -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 diff --git a/winnativeeventfilter.cpp b/winnativeeventfilter.cpp index c94bb08..c3f9413 100644 --- a/winnativeeventfilter.cpp +++ b/winnativeeventfilter.cpp @@ -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 diff --git a/winnativeeventfilter.h b/winnativeeventfilter.h index 96c4e84..7ed0792 100644 --- a/winnativeeventfilter.h +++ b/winnativeeventfilter.h @@ -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 */);