From d6513a7409bccd21d31504331d7032bc1b5709c3 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 14 Apr 2023 10:47:16 +0800 Subject: [PATCH] chore: use option background brush MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用 option 中的 brush 而非 QPainter 设置的 brush 防止出现应用设置 QPainter brush 后污染后续绘制 also FIX https://github.com/linuxdeepin/developer-center/issues/4068 --- styleplugins/chameleon/chameleonstyle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/styleplugins/chameleon/chameleonstyle.cpp b/styleplugins/chameleon/chameleonstyle.cpp index 1f51aea9..7748f7b3 100644 --- a/styleplugins/chameleon/chameleonstyle.cpp +++ b/styleplugins/chameleon/chameleonstyle.cpp @@ -258,9 +258,12 @@ void ChameleonStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOpti return; } else { if (vopt->backgroundBrush.style() != Qt::NoBrush) { + p->save(); p->setPen(Qt::NoPen); + p->setBrush(vopt->backgroundBrush); p->setRenderHint(QPainter::Antialiasing); p->drawRoundedRect(opt->rect, frame_radius, frame_radius); + p->restore(); return; } }