Skip to content

Fix mixup of PM_ToolBarItemMargin & PM_ToolBarFrameWidth

While Breeze draws no frames around toolbars, yet it had the style hint for the frame width set to 6, while having the actual toolbar margin set to 0.

The possible cause is that PM_ToolBarItemMargin was only introduced for Qt4, so seemingly Qt3 times' workaround to set the margin via the frame width instead of having more of the CSS box model now available missed to be adapted to in the minds of the style developers.

Qt's own codee uses PM_ToolBarItemMargin & PM_ToolBarFrameWidth to calculate the QToolbar layout's contentmargin, so switching the values results in no actual change there. See QToolBarLayout::updateMarginAndSpacing()

The only other use is PM_ToolBarFrameWidth for initializing the QStyleOptionToolBar::lineWidth, which though is unused by Oxygen drawing code, so the change also has no effect. See QToolBar::initStyleOption(QStyleOptionToolBar *option)

But 3rd-party code querying the pixel metric for these two values after this patch gets proper values and can properly align custom UI painting with the styled toolbar.

And tested with Okular, Okteta, Kate, KDevelop, Dolphin, all look the same by the pixel, as assumed by the seen code :)

Edited by Friedrich W. H. Kossebau

Merge request reports