mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-25 16:48:44 +02: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:
parent
cd69bf074f
commit
43ff84ba48
@ -464,6 +464,9 @@ void ToolBar::Create( wxWindow *parent )
|
|||||||
|
|
||||||
void ToolBar::ReCreateButtons()
|
void ToolBar::ReCreateButtons()
|
||||||
{
|
{
|
||||||
|
wxSize sz3 = GetSize();
|
||||||
|
wxLogDebug( "x:%i y:%i",sz3.x, sz3.y);
|
||||||
|
|
||||||
// SetSizer(NULL) detaches mHSizer and deletes it.
|
// SetSizer(NULL) detaches mHSizer and deletes it.
|
||||||
// Do not use Detach() here, as that attempts to detach mHSizer from itself!
|
// Do not use Detach() here, as that attempts to detach mHSizer from itself!
|
||||||
SetSizer( NULL );
|
SetSizer( NULL );
|
||||||
@ -512,14 +515,19 @@ void ToolBar::ReCreateButtons()
|
|||||||
// Set the true AND minimum sizes and do final layout
|
// Set the true AND minimum sizes and do final layout
|
||||||
if(IsResizable())
|
if(IsResizable())
|
||||||
{
|
{
|
||||||
sz.SetWidth(GetMinToolbarWidth());
|
|
||||||
// JKC we're going to allow all resizable toolbars to be resized
|
// 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;
|
wxSize sz2 = sz;
|
||||||
|
sz2.SetWidth(GetMinToolbarWidth());
|
||||||
sz2.y = tbs -1;
|
sz2.y = tbs -1;
|
||||||
SetMinSize(sz2);
|
SetMinSize(sz2);
|
||||||
sz.SetWidth(GetInitialWidth());
|
// Initial size at least as big as minimum.
|
||||||
SetSize(sz);
|
if( sz3.y < sz2.y )
|
||||||
|
sz3.y = sz2.y;
|
||||||
|
if( sz3.x < sz2.x )
|
||||||
|
sz3.x = GetInitialWidth();
|
||||||
|
//sz.SetWidth();
|
||||||
|
SetSize(sz3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -525,6 +525,7 @@ void ToolManager::Reset()
|
|||||||
(entry.rightOf == NoBarID) ? nullptr : mBars[ entry.rightOf ].get(),
|
(entry.rightOf == NoBarID) ? nullptr : mBars[ entry.rightOf ].get(),
|
||||||
(entry.below == NoBarID) ? nullptr : mBars[ entry.below ].get()
|
(entry.below == NoBarID) ? nullptr : mBars[ entry.below ].get()
|
||||||
};
|
};
|
||||||
|
bar->SetSize( 20,20 );
|
||||||
|
|
||||||
wxWindow *floater;
|
wxWindow *floater;
|
||||||
ToolDock *dock;
|
ToolDock *dock;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user