Skip to content

Commit

Permalink
chore: use option background brush
Browse files Browse the repository at this point in the history
使用 option 中的 brush 而非 QPainter 设置的 brush
防止出现应用设置 QPainter  brush 后污染后续绘制
also FIX linuxdeepin/developer-center#4068
  • Loading branch information
kegechen committed Apr 14, 2023
1 parent 9970684 commit 158c9e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions styleplugins/chameleon/chameleonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 158c9e5

Please sign in to comment.