Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.2
-
None
Description
The QToolBar extension button inherits styling from QToolButton. When said styling affects the size of those buttons, it is not taken into account for the extension button.
In the above exaggerated example, I have applied the following styling to QToolButtons:
QToolBar QToolButton { background: red; border: 1px solid yellow; margin: 0; padding: 0; width: 32px; height: 32px; max-width: 32px; max-height: 32px; }
Despite the large size of the buttons here, the extension button is mostly cutoff due to being a fixed width of 12px. Applying a negative margin-left to the extension button cuts off the left side and reveals the center of it, where the icon can then be seen.
My naive understanding is that this is due to QStyleSheetStyle::pixelMetric() having no handling for PM_ToolBarExtensionExtent
case PM_ToolBarExtensionExtent: break;
Thus it resolves to the value set in QCommonStyle::pixelMetric()
case PM_MenuButtonIndicator: ret = int(QStyleHelper::dpiScaled(12, opt)); break;
Expected Behaviour
The extension button is styled like the other QToolButtons and given the correct amount of space in the toolbar.
Extension button visible
Extension button not needed