From 1c3ac492b044ec1a9ea25a2cd224647de7d4ba98 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 7 Nov 2022 13:37:56 +0100 Subject: [PATCH] Rearrange ParamSlider fields --- nih_plug_vizia/src/widgets/param_slider.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nih_plug_vizia/src/widgets/param_slider.rs b/nih_plug_vizia/src/widgets/param_slider.rs index d8e417ef..ec2167f5 100644 --- a/nih_plug_vizia/src/widgets/param_slider.rs +++ b/nih_plug_vizia/src/widgets/param_slider.rs @@ -18,6 +18,9 @@ const GRANULAR_DRAG_MULTIPLIER: f32 = 0.1; pub struct ParamSlider { param_base: ParamWidgetBase, + /// Will be set to `true` when the field gets Alt+Click'ed which will replace the label with a + /// text box. + text_input_active: bool, /// Will be set to `true` if we're dragging the parameter. Resetting the parameter or entering a /// text value should not initiate a drag. drag_active: bool, @@ -26,11 +29,9 @@ pub struct ParamSlider { /// active. granular_drag_start_x_value: Option<(f32, f32)>, + // These fields are set through modifiers: /// What style to use for the slider. style: ParamSliderStyle, - /// Will be set to `true` when the field gets Alt+Click'ed which will replace the label with a - /// text box. - text_input_active: bool, } /// How the [`ParamSlider`] should display its values. Set this using @@ -87,11 +88,11 @@ impl ParamSlider { Self { param_base: ParamWidgetBase::new(cx, params.clone(), params_to_param), + text_input_active: false, drag_active: false, granular_drag_start_x_value: None, style: ParamSliderStyle::Centered, - text_input_active: false, } .build( cx,