Don't add extra padding in wxMSW wxToolBar best size calculation

DoGetBestSize() mistakenly added extra (half of) padding for each tool
explicitly when the padding is already taken into account of by
GetToolSize() itself, so this resulted in extra space at the end of the
toolbar proportional to the number of buttons in it.
This commit is contained in:
Vadim Zeitlin
2019-04-05 13:38:07 +02:00
parent 25e9be6873
commit 0dfe0d0a9c

View File

@@ -605,7 +605,7 @@ wxSize wxToolBar::DoGetBestSize() const
{ {
if ( !tool->IsControl() ) if ( !tool->IsControl() )
{ {
sizeBest.y += sizeTool.y + m_toolPacking; sizeBest.y += sizeTool.y;
} }
//else: Controls are not shown in vertical toolbars at all. //else: Controls are not shown in vertical toolbars at all.
} }
@@ -624,10 +624,6 @@ wxSize wxToolBar::DoGetBestSize() const
{ {
sizeBest.x += sizeTool.x; sizeBest.x += sizeTool.x;
} }
// As explained in MSWGetFittingtSizeForControl() above, the actual
// margin used for a single tool is one half of the total packing.
sizeBest.x += m_toolPacking / 2;
} }
} }