Windows11Style: Use correct font when a pushbutton has a menu
When a pushbutton has a menu, the menu indicator is drawn as the glyph ChevronDown from Segoe Fluent Icons font. But later the font is not reset so it's also used for the push buttons label. Since the icon font has no valid glyphs for most of the characters, a replacement is used but this might not be the one set for the pushbutton. Change-Id: I25c9b993450e7fe740addb153259f46b570ad8f7 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 1c26a93b3d5cccd48d18ef2e8b1879c093c15794) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 438516cf349df4e52e0d15b50b332f3002cb7315)
This commit is contained in:
parent
3f3541d49f
commit
4d6642eee4
@ -1360,6 +1360,7 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op
|
||||
int indicatorSize = proxy()->pixelMetric(PM_MenuButtonIndicator, btn, widget);
|
||||
QLineF menuSplitter;
|
||||
QRectF indicatorRect;
|
||||
painter->save();
|
||||
painter->setFont(assetFont);
|
||||
|
||||
if (btn->direction == Qt::LeftToRight) {
|
||||
@ -1376,6 +1377,7 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op
|
||||
painter->drawText(indicatorRect, QStringLiteral(u"\uE70D"), Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
painter->setPen(QPen(WINUI3Colors[colorSchemeIndex][controlStrokePrimary]));
|
||||
painter->drawLine(menuSplitter);
|
||||
painter->restore();
|
||||
}
|
||||
if (!btn->icon.isNull()) {
|
||||
//Center both icon and text
|
||||
|
Loading…
x
Reference in New Issue
Block a user