From e48a0d5eb8672c358c256e381dffb8fc9701220b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 22 Mar 2022 18:55:08 +0100 Subject: [PATCH] Actually only use CurrentStepLabeled for booleans The number of steps is of course the number of possible values minus one. --- nih_plug_vizia/src/widgets/generic_ui.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nih_plug_vizia/src/widgets/generic_ui.rs b/nih_plug_vizia/src/widgets/generic_ui.rs index d1f4ddcd..446a980f 100644 --- a/nih_plug_vizia/src/widgets/generic_ui.rs +++ b/nih_plug_vizia/src/widgets/generic_ui.rs @@ -50,7 +50,9 @@ impl GenericUi { } } .set_style(match unsafe { param_ptr.step_count() } { - Some(step_count) if step_count <= 2 => ParamSliderStyle::CurrentStepLabeled, + // This looks nice for boolean values, but it's too crowded for anything beyond + // that without making the widget wider + Some(step_count) if step_count <= 1 => ParamSliderStyle::CurrentStepLabeled, Some(step_count) if step_count <= 64 => ParamSliderStyle::CurrentStep, Some(_) => ParamSliderStyle::FromLeft, // This is already the default, but continuous parameters should be drawn from