QDockWidget: fix dock buttons size

The previous fix calculated an icon size of 12 instead 10 for the icon
size when SH_DockWidget_ButtonsHaveFrame is set. This lead to a too
large icon. It was also rendered blurry because there was no native png
with 12x12 pixels so it has to be scaled.

This amends 04f4b27774ba70ebba425394fa8a1ffdffb2483b

Fixes: QTBUG-122214
Task-number: QTBUG-118643
Change-Id: Iaf332a21681e5b84222299d79d4b28d0c26b0cda
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8eb599566ea983869298fe1f3362918bf0651f11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2024-02-15 19:22:56 +01:00 committed by Qt Cherry-pick Bot
parent 3d01456b10
commit c63ecb05ce

View File

@ -133,7 +133,7 @@ QSize QDockWidgetTitleButton::dockButtonIconSize() const
if (m_iconSize < 0) {
m_iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize, nullptr, this);
if (style()->styleHint(QStyle::SH_DockWidget_ButtonsHaveFrame, nullptr, this))
m_iconSize = (m_iconSize * 3) / 4;
m_iconSize = (m_iconSize * 5) / 8; // 16 -> 10
}
return QSize(m_iconSize, m_iconSize);
}