From 91f71f8988ad1c1091e6a91952b60d346dddc0d4 Mon Sep 17 00:00:00 2001 From: Ye ShanShan Date: Wed, 3 Jul 2024 15:56:30 +0800 Subject: [PATCH] fix: can't set transparent for Menu's background Menu's background always fill a color even it's transparent. in somecase we need fill background by caller. --- styleplugins/chameleon/chameleonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styleplugins/chameleon/chameleonstyle.cpp b/styleplugins/chameleon/chameleonstyle.cpp index 2101c0b3..7c72abb5 100644 --- a/styleplugins/chameleon/chameleonstyle.cpp +++ b/styleplugins/chameleon/chameleonstyle.cpp @@ -2812,7 +2812,7 @@ void ChameleonStyle::drawMenuItemBackground(const QStyleOption *option, QPainter } else { color = option->palette.window().color(); - if (color.color().isValid()) { + if (color.color().isValid() && color.color().alpha() != 0) { QColor c = color.color(); // 未开启窗口混成时不应该设置背景色的alpha通道,应当显示纯色背景(设置StyleSheet时,不加载此设置,防止alpha通道等对其造成影响)