mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Preserve toolbar size when theming.
Particularly relevant for resizable toolbars which may be bigger or smaller than their standard initial size.
This commit is contained in:
@@ -464,6 +464,9 @@ void ToolBar::Create( wxWindow *parent )
|
||||
|
||||
void ToolBar::ReCreateButtons()
|
||||
{
|
||||
wxSize sz3 = GetSize();
|
||||
wxLogDebug( "x:%i y:%i",sz3.x, sz3.y);
|
||||
|
||||
// SetSizer(NULL) detaches mHSizer and deletes it.
|
||||
// Do not use Detach() here, as that attempts to detach mHSizer from itself!
|
||||
SetSizer( NULL );
|
||||
@@ -512,14 +515,19 @@ void ToolBar::ReCreateButtons()
|
||||
// Set the true AND minimum sizes and do final layout
|
||||
if(IsResizable())
|
||||
{
|
||||
sz.SetWidth(GetMinToolbarWidth());
|
||||
// JKC we're going to allow all resizable toolbars to be resized
|
||||
// to 1 unit high!
|
||||
// to 1 unit high, typically 27 pixels.
|
||||
wxSize sz2 = sz;
|
||||
sz2.SetWidth(GetMinToolbarWidth());
|
||||
sz2.y = tbs -1;
|
||||
SetMinSize(sz2);
|
||||
sz.SetWidth(GetInitialWidth());
|
||||
SetSize(sz);
|
||||
// Initial size at least as big as minimum.
|
||||
if( sz3.y < sz2.y )
|
||||
sz3.y = sz2.y;
|
||||
if( sz3.x < sz2.x )
|
||||
sz3.x = GetInitialWidth();
|
||||
//sz.SetWidth();
|
||||
SetSize(sz3);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user