diff --git a/plugins/spectral_compressor/src/compressor_bank.rs b/plugins/spectral_compressor/src/compressor_bank.rs index aadb03a1..94b71fe1 100644 --- a/plugins/spectral_compressor/src/compressor_bank.rs +++ b/plugins/spectral_compressor/src/compressor_bank.rs @@ -102,10 +102,10 @@ pub struct ThresholdParams { /// Contains the compressor parameters for both the upwards and downwards compressor banks. #[derive(Params)] pub struct CompressorBankParams { - #[nested = "downwards"] - pub downwards: Arc, #[nested = "upwards"] pub upwards: Arc, + #[nested = "downwards"] + pub downwards: Arc, } /// This struct contains the parameters for either the upward or downward compressors. The `Params` diff --git a/plugins/spectral_compressor/src/editor.rs b/plugins/spectral_compressor/src/editor.rs index 6f5cf4d4..91fa43cc 100644 --- a/plugins/spectral_compressor/src/editor.rs +++ b/plugins/spectral_compressor/src/editor.rs @@ -106,41 +106,6 @@ pub(crate) fn create( .width(Stretch(1.0)); HStack::new(cx, |cx| { - VStack::new(cx, |cx| { - Label::new(cx, "Downwards") - .font(assets::NOTO_SANS_THIN) - .font_size(30.0 * POINT_SCALE) - .left(Stretch(1.0)) - .right(Pixels(10.0)) - .bottom(Pixels(-10.0)); - - // We don't want to show the 'Downwards' prefix here, but it should still be in - // the parameter name so the parameter list makes sense - let downwards_compressor_params = - Data::params.map(|p| p.compressors.downwards.clone()); - GenericUi::new_custom( - cx, - downwards_compressor_params.clone(), - move |cx, param_ptr| { - let downwards_compressor_params = downwards_compressor_params.clone(); - HStack::new(cx, move |cx| { - Label::new( - cx, - unsafe { param_ptr.name() } - .strip_prefix("Downwards ") - .expect("Expected parameter name prefix, this is a bug"), - ) - .class("label"); - - GenericUi::draw_widget(cx, downwards_compressor_params, param_ptr); - }) - .class("row"); - }, - ); - }) - .width(LEFT_COLUMN_WIDTH) - .height(Auto); - VStack::new(cx, |cx| { Label::new(cx, "Upwards") .font(assets::NOTO_SANS_THIN) @@ -149,6 +114,8 @@ pub(crate) fn create( .right(Pixels(10.0)) .bottom(Pixels(-10.0)); + // We don't want to show the 'Upwards' prefix here, but it should still be in + // the parameter name so the parameter list makes sense let upwards_compressor_params = Data::params.map(|p| p.compressors.upwards.clone()); GenericUi::new_custom( @@ -173,6 +140,39 @@ pub(crate) fn create( }) .width(RIGHT_COLUMN_WIDTH) .height(Auto); + + VStack::new(cx, |cx| { + Label::new(cx, "Downwards") + .font(assets::NOTO_SANS_THIN) + .font_size(30.0 * POINT_SCALE) + .left(Stretch(1.0)) + .right(Pixels(10.0)) + .bottom(Pixels(-10.0)); + + let downwards_compressor_params = + Data::params.map(|p| p.compressors.downwards.clone()); + GenericUi::new_custom( + cx, + downwards_compressor_params.clone(), + move |cx, param_ptr| { + let downwards_compressor_params = downwards_compressor_params.clone(); + HStack::new(cx, move |cx| { + Label::new( + cx, + unsafe { param_ptr.name() } + .strip_prefix("Downwards ") + .expect("Expected parameter name prefix, this is a bug"), + ) + .class("label"); + + GenericUi::draw_widget(cx, downwards_compressor_params, param_ptr); + }) + .class("row"); + }, + ); + }) + .width(LEFT_COLUMN_WIDTH) + .height(Auto); }) .height(Auto) .width(Stretch(1.0));