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 04f4b27774
Pick-to: 6.7
Fixes: QTBUG-122214
Task-number: QTBUG-118643
Change-Id: Iaf332a21681e5b84222299d79d4b28d0c26b0cda
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
bb10
parent
76a7057bf5
commit
8eb599566e
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue