1
0
Fork 0

Actually only use CurrentStepLabeled for booleans

The number of steps is of course the number of possible values minus
one.
This commit is contained in:
Robbert van der Helm 2022-03-22 18:55:08 +01:00
parent deb9b50eab
commit e48a0d5eb8

View file

@ -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