mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-04 16:14:00 +01:00
Bug 1983 - Preference updates do not preserve toolbar widths
This commit is contained in:
@@ -459,6 +459,13 @@ void ToolBar::Create( wxWindow *parent )
|
|||||||
mVisible = true;
|
mVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToolBar::SetToDefaultSize(){
|
||||||
|
wxSize sz;
|
||||||
|
sz.SetHeight( -1 );
|
||||||
|
sz.SetWidth( GetInitialWidth());
|
||||||
|
SetSize( sz );
|
||||||
|
}
|
||||||
|
|
||||||
void ToolBar::ReCreateButtons()
|
void ToolBar::ReCreateButtons()
|
||||||
{
|
{
|
||||||
wxSize sz3 = GetSize();
|
wxSize sz3 = GetSize();
|
||||||
@@ -519,12 +526,18 @@ void ToolBar::ReCreateButtons()
|
|||||||
sz2.SetWidth(GetMinToolbarWidth());
|
sz2.SetWidth(GetMinToolbarWidth());
|
||||||
sz2.y = tbs -1;
|
sz2.y = tbs -1;
|
||||||
SetMinSize(sz2);
|
SetMinSize(sz2);
|
||||||
// Initial size at least as big as minimum.
|
|
||||||
|
// sz2 is now the minimum size.
|
||||||
|
// sz3 is the size we were.
|
||||||
|
// When recreating buttons, we want to preserve size.
|
||||||
|
// But not if that makes the size too small.
|
||||||
|
|
||||||
|
// Size at least as big as minimum.
|
||||||
if( sz3.y < sz2.y )
|
if( sz3.y < sz2.y )
|
||||||
sz3.y = sz2.y;
|
sz3.y = sz2.y;
|
||||||
//if( sz3.x < sz2.x )
|
if( sz3.x < sz2.x )
|
||||||
sz3.x = GetInitialWidth();
|
sz3.x = sz2.x;
|
||||||
//sz.SetWidth();
|
|
||||||
SetSize(sz3);
|
SetSize(sz3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ class ToolBar /* not final */ : public wxPanelWrapper
|
|||||||
|
|
||||||
bool AcceptsFocus() const override { return false; };
|
bool AcceptsFocus() const override { return false; };
|
||||||
|
|
||||||
|
void SetToDefaultSize();
|
||||||
//NEW virtuals:
|
//NEW virtuals:
|
||||||
virtual void Create(wxWindow *parent);
|
virtual void Create(wxWindow *parent);
|
||||||
virtual void EnableDisableButtons() = 0;
|
virtual void EnableDisableButtons() = 0;
|
||||||
|
|||||||
@@ -546,6 +546,7 @@ void ToolManager::Reset()
|
|||||||
floater->Destroy();
|
floater->Destroy();
|
||||||
|
|
||||||
// Recreate bar buttons (and resize it)
|
// Recreate bar buttons (and resize it)
|
||||||
|
bar->SetToDefaultSize();
|
||||||
bar->ReCreateButtons();
|
bar->ReCreateButtons();
|
||||||
bar->EnableDisableButtons();
|
bar->EnableDisableButtons();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user