diff --git a/styleplugins/chameleon/chameleonstyle.cpp b/styleplugins/chameleon/chameleonstyle.cpp index 52234f4..c2cff5e 100644 --- a/styleplugins/chameleon/chameleonstyle.cpp +++ b/styleplugins/chameleon/chameleonstyle.cpp @@ -2808,7 +2808,18 @@ void ChameleonStyle::drawMenuItemBackground(const QStyleOption *option, QPainter } } - painter->fillRect(option->rect, color); + painter->setBrush(color); + painter->setPen(Qt::NoPen); + painter->setRenderHint(QPainter::Antialiasing); + + const int radius = DStyle::pixelMetric(PM_FrameRadius); + constexpr int margin = 6; + + if (qobject_cast(option->styleObject)) + painter->drawRoundedRect(option->rect, radius, radius); + else + painter->drawRoundedRect(option->rect.marginsRemoved(QMargins(margin, 0, margin, 0)), radius, radius); + } else { color = option->palette.window().color(); @@ -2833,8 +2844,6 @@ void ChameleonStyle::drawMenuItemBackground(const QStyleOption *option, QPainter color = c; } - painter->fillRect(option->rect, color); - if (type == QStyleOptionMenuItem::Separator) { QColor colorSeparator; DGuiApplicationHelper *guiAppHelp = DGuiApplicationHelper::instance(); @@ -4196,7 +4205,7 @@ int ChameleonStyle::pixelMetric(QStyle::PixelMetric m, const QStyleOption *opt, case PM_MenuVMargin: return 8; case PM_MenuHMargin: - return 0; + return 8; default: break; }