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:
@@ -605,7 +605,7 @@ wxSize wxToolBar::DoGetBestSize() const
|
||||
{
|
||||
if ( !tool->IsControl() )
|
||||
{
|
||||
sizeBest.y += sizeTool.y + m_toolPacking;
|
||||
sizeBest.y += sizeTool.y;
|
||||
}
|
||||
//else: Controls are not shown in vertical toolbars at all.
|
||||
}
|
||||
@@ -624,10 +624,6 @@ wxSize wxToolBar::DoGetBestSize() const
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user