mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 00:50:05 +02:00
Define and use ShuttleGui::Size
This commit is contained in:
parent
dd954247d3
commit
930c21dc2a
@ -2089,6 +2089,9 @@ void ShuttleGuiBase::UpdateSizersCore(bool bPrepend, int Flags, bool prompt)
|
||||
else if( mItem.mHasMinSize )
|
||||
mpWind->SetMinSize( mItem.mMinSize );
|
||||
|
||||
if ( mItem.mWindowSize != wxSize{} )
|
||||
mpWind->SetSize( mItem.mWindowSize );
|
||||
|
||||
// Reset to defaults
|
||||
mItem = {};
|
||||
}
|
||||
|
@ -221,6 +221,12 @@ struct Item {
|
||||
return std::move( *this );
|
||||
}
|
||||
|
||||
Item&& Size( wxSize size ) &&
|
||||
{
|
||||
mWindowSize = size;
|
||||
return std::move( *this );
|
||||
}
|
||||
|
||||
std::function< void(wxWindow*) > mValidatorSetter;
|
||||
TranslatableString mToolTip;
|
||||
TranslatableString mName;
|
||||
@ -233,6 +239,8 @@ struct Item {
|
||||
// Applies to windows, not to subsizers
|
||||
int mWindowPositionFlags{ 0 };
|
||||
|
||||
wxSize mWindowSize{};
|
||||
|
||||
wxSize mMinSize{ -1, -1 };
|
||||
bool mHasMinSize{ false };
|
||||
bool mUseBestSize{ false };
|
||||
@ -663,6 +671,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
ShuttleGui & Size( wxSize size )
|
||||
{
|
||||
std::move( mItem ).Size( size );
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Prop() sets the proportion value, defined as in wxSizer::Add().
|
||||
ShuttleGui & Prop( int iProp ){ ShuttleGuiBase::Prop(iProp); return *this;}; // Has to be here too, to return a ShuttleGui and not a ShuttleGuiBase.
|
||||
|
||||
|
@ -871,7 +871,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
|
||||
for (int i = 0; (i < NUMBER_OF_BANDS) && (kThirdOct[i] <= mHiFreq); ++i)
|
||||
{
|
||||
mSliders[i] = safenew wxSliderWrapper(pParent, ID_Slider + i, 0, -20, +20,
|
||||
wxDefaultPosition, wxSize(-1,150), wxSL_VERTICAL | wxSL_INVERSE);
|
||||
wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE);
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
mSliders[i]->SetAccessible(safenew SliderAx(mSliders[i], _("%d dB")));
|
||||
@ -889,6 +889,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
|
||||
.ConnectRoot(
|
||||
wxEVT_ERASE_BACKGROUND, &EffectEqualization::OnErase)
|
||||
.Position(wxEXPAND)
|
||||
.Size( { -1, 150 } )
|
||||
.AddWindow( mSliders[i] );
|
||||
}
|
||||
S.AddSpace(15,0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user