1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-17 08:17:59 +01:00

Don't increase width when a toolbar is repeatedly docked and undocked

This commit is contained in:
Paul Licameli
2016-06-11 16:29:25 -04:00
parent 9e74613a8e
commit 82cf9b3ab6
4 changed files with 19 additions and 10 deletions

View File

@@ -129,14 +129,19 @@ int ToolDock::GetBarCount()
//
// Handle ToolDock events
//
void ToolDock::Dock( ToolBar *bar, int before )
void ToolDock::Dock( ToolBar *bar, bool deflate, int before )
{
// Adopt the toolbar into our family
bar->Reparent( this );
mBars[ bar->GetId() ] = bar;
// Reset height
bar->SetSize( bar->GetSize().x, bar->GetDockedSize().y );
// Reset size
bar->SetSize(
// Undo the expansion that was applied when un-docking
bar->GetSize().x - (deflate ? 2 * ToolBarFloatMargin : 0),
// Don't need to adjust y the same way.
bar->GetDockedSize().y
);
// Park the NEW bar in the correct berth
if( before >= 0 && before < (int)mDockedBars.GetCount() )