Commit 3d96c335 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

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.
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.

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.

(cherry picked from commit 4c8934af)
parent 9729b2a3
Pipeline #184228 passed with stage
in 1 minute and 34 seconds
......@@ -97,11 +97,12 @@ namespace Breeze
static constexpr int ScrollBar_DoubleButtonHeight = 2*ScrollBar_Extend;
// toolbars
static constexpr int ToolBar_FrameWidth = 6;
static constexpr int ToolBar_FrameWidth = 0;
static constexpr int ToolBar_HandleExtent = 10;
static constexpr int ToolBar_HandleWidth = 6;
static constexpr int ToolBar_SeparatorWidth = 8;
static constexpr int ToolBar_ExtensionWidth = 20;
static constexpr int ToolBar_ItemMargin = 6;
static constexpr int ToolBar_ItemSpacing = 0;
// progressbars
......
......@@ -647,7 +647,7 @@ namespace Breeze
case PM_ToolBarExtensionExtent:
return pixelMetric( PM_SmallIconSize, option, widget ) + 2*Metrics::ToolButton_MarginWidth;
case PM_ToolBarItemMargin: return 0;
case PM_ToolBarItemMargin: return Metrics::ToolBar_ItemMargin;
case PM_ToolBarItemSpacing: return Metrics::ToolBar_ItemSpacing;
// tabbars
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment