From b23d98fd0577a907d4372c1a4b4e35981a3fcedc Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 25 Feb 2020 10:09:53 -0500 Subject: [PATCH] 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. --- src/ShuttleGui.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index bd45232f5..03e7c9de7 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -2057,6 +2057,17 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt) // override the given Flags 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( bPrepend ) { @@ -2069,7 +2080,7 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt) } if (!prompt) { - // Apply certain optional window attributes here + // Apply certain other optional window attributes here if ( mItem.mValidatorSetter ) mItem.mValidatorSetter( mpWind ); @@ -2098,14 +2109,6 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt) for (auto &pair : mItem.mRootConnections) 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 mItem = {}; }