1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-22 15:20:15 +02:00

Bug2289: initial sizing of export mixer slider on Linux...

... bug began at bed7b41af98243ec0760e3d48cbb53c0de0e1367

Apparently, for GTK one must set the size of a slider before adding it to a
sizer.
This commit is contained in:
Paul Licameli 2020-02-25 10:09:53 -05:00
parent 72ece7d9bf
commit b23d98fd05

View File

@ -2057,6 +2057,17 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt)
// override the given Flags // override the given Flags
useFlags = mItem.mWindowPositionFlags; useFlags = mItem.mWindowPositionFlags;
if (!prompt) {
// Do these steps before adding the window to the sizer
if( mItem.mUseBestSize )
mpWind->SetMinSize( mpWind->GetBestSize() );
else if( mItem.mHasMinSize )
mpWind->SetMinSize( mItem.mMinSize );
if ( mItem.mWindowSize != wxSize{} )
mpWind->SetSize( mItem.mWindowSize );
}
if( mpSizer){ if( mpSizer){
if( bPrepend ) if( bPrepend )
{ {
@ -2069,7 +2080,7 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt)
} }
if (!prompt) { if (!prompt) {
// Apply certain optional window attributes here // Apply certain other optional window attributes here
if ( mItem.mValidatorSetter ) if ( mItem.mValidatorSetter )
mItem.mValidatorSetter( mpWind ); mItem.mValidatorSetter( mpWind );
@ -2098,14 +2109,6 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt)
for (auto &pair : mItem.mRootConnections) for (auto &pair : mItem.mRootConnections)
mpWind->Connect( pair.first, pair.second, nullptr, mpDlg ); mpWind->Connect( pair.first, pair.second, nullptr, mpDlg );
if( mItem.mUseBestSize )
mpWind->SetMinSize( mpWind->GetBestSize() );
else if( mItem.mHasMinSize )
mpWind->SetMinSize( mItem.mMinSize );
if ( mItem.mWindowSize != wxSize{} )
mpWind->SetSize( mItem.mWindowSize );
// Reset to defaults // Reset to defaults
mItem = {}; mItem = {};
} }