Rearrange ParamSlider fields
This commit is contained in:
parent
677f21005d
commit
1c3ac492b0
|
@ -18,6 +18,9 @@ const GRANULAR_DRAG_MULTIPLIER: f32 = 0.1;
|
||||||
pub struct ParamSlider {
|
pub struct ParamSlider {
|
||||||
param_base: ParamWidgetBase,
|
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
|
/// Will be set to `true` if we're dragging the parameter. Resetting the parameter or entering a
|
||||||
/// text value should not initiate a drag.
|
/// text value should not initiate a drag.
|
||||||
drag_active: bool,
|
drag_active: bool,
|
||||||
|
@ -26,11 +29,9 @@ pub struct ParamSlider {
|
||||||
/// active.
|
/// active.
|
||||||
granular_drag_start_x_value: Option<(f32, f32)>,
|
granular_drag_start_x_value: Option<(f32, f32)>,
|
||||||
|
|
||||||
|
// These fields are set through modifiers:
|
||||||
/// What style to use for the slider.
|
/// What style to use for the slider.
|
||||||
style: ParamSliderStyle,
|
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
|
/// How the [`ParamSlider`] should display its values. Set this using
|
||||||
|
@ -87,11 +88,11 @@ impl ParamSlider {
|
||||||
Self {
|
Self {
|
||||||
param_base: ParamWidgetBase::new(cx, params.clone(), params_to_param),
|
param_base: ParamWidgetBase::new(cx, params.clone(), params_to_param),
|
||||||
|
|
||||||
|
text_input_active: false,
|
||||||
drag_active: false,
|
drag_active: false,
|
||||||
granular_drag_start_x_value: None,
|
granular_drag_start_x_value: None,
|
||||||
|
|
||||||
style: ParamSliderStyle::Centered,
|
style: ParamSliderStyle::Centered,
|
||||||
text_input_active: false,
|
|
||||||
}
|
}
|
||||||
.build(
|
.build(
|
||||||
cx,
|
cx,
|
||||||
|
|
Loading…
Reference in a new issue