1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-26 09:28:07 +02:00

Bug 2120 - Residual: Truncation of Selection toolbar too.

The problem was more general, and it affected the selection toolbar too, if undocked.
This commit is contained in:
James Crook 2019-07-28 17:28:58 +01:00
parent 2b15aa28ca
commit 529e1b2b38
2 changed files with 7 additions and 9 deletions

View File

@ -369,15 +369,7 @@ void SpectralSelectionBar::OnChoice(wxCommandEvent &)
GetSizer()->Layout(); // Required so that the layout does not mess up on Windows when changing the format. GetSizer()->Layout(); // Required so that the layout does not mess up on Windows when changing the format.
wxWindowBase::GetSizer()->SetMinSize(wxSize(0, mHeight)); // so that height of toolbar does not change wxWindowBase::GetSizer()->SetMinSize(wxSize(0, mHeight)); // so that height of toolbar does not change
wxWindowBase::GetSizer()->SetSizeHints(this); wxWindowBase::GetSizer()->SetSizeHints(this);
if( IsDocked() ) Updated();
Updated();
else {
// Bug 2120. Changing the choice also changes the size of the toolbar so
// we need to update the client size, even if undocked.
// If attempting to make this code nicer, remember to test both changing the choice,
// and the choice remaining the same.
GetParent()->SetClientSize( GetSize() + wxSize( 2,2));
}
} }
void SpectralSelectionBar::OnIdle( wxIdleEvent &evt ) void SpectralSelectionBar::OnIdle( wxIdleEvent &evt )

View File

@ -617,6 +617,12 @@ void ToolBar::Updated()
{ {
if( IsDocked() ) if( IsDocked() )
GetDock()->Updated(); GetDock()->Updated();
else
// Bug 2120. Changing the choice also changes the size of the toolbar so
// we need to update the client size, even if undocked.
// If modifying/improving this, remember to test both changing the choice,
// and clciking on the choice but not actually changing it.
GetParent()->SetClientSize( GetSize() + wxSize( 2,2));
//wxCommandEvent e( EVT_TOOLBAR_UPDATED, GetId() ); //wxCommandEvent e( EVT_TOOLBAR_UPDATED, GetId() );
//GetParent()->GetEventHandler()->AddPendingEvent( e ); //GetParent()->GetEventHandler()->AddPendingEvent( e );
} }