QWindows11Style: Decrease bottomline frame thickness for QToolButton

Decrease the bottom line frame thickness for QToolButton by using
fractional coordinates.

Task-number: QTBUG-132261
Pick-to: 6.8
Change-Id: I77a3acdd20c694dce38d809db9c3051949a98fa3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3e9baca7d2197bfc10d20de6f326e2749a8f781e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Wladimir Leuschner 2024-12-17 15:13:16 +01:00 committed by Qt Cherry-pick Bot
parent 2c4756af80
commit f8adee805b

View File

@ -908,7 +908,7 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
else
painter->setPen(QPen(WINUI3Colors[colorSchemeIndex][controlStrokePrimary]));
painter->setBrush(buttonFillBrush(option));
painter->drawRoundedRect(rect.marginsAdded(QMargins(0.5, 0.5, 0.5, 0.5)),
painter->drawRoundedRect(rect,
secondLevelRoundingRadius, secondLevelRoundingRadius);
painter->setPen(Qt::NoPen);
@ -920,8 +920,9 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
painter->setBrush(option->palette.button());
painter->drawRoundedRect(rect, secondLevelRoundingRadius, secondLevelRoundingRadius);
if (isRaised) {
const qreal sublineOffset = secondLevelRoundingRadius - 0.5;
painter->setPen(QPen(WINUI3Colors[colorSchemeIndex][controlStrokeSecondary]));
painter->drawLine(rect.bottomLeft() + QPoint(2,1), rect.bottomRight() + QPoint(-2,1));
painter->drawLine(rect.bottomLeft() + QPointF(sublineOffset, 0.5), rect.bottomRight() + QPointF(-sublineOffset, 0.5));
}
}
break;