Description
Slider type LV_SLIDER_TYPE_SYMMETRICAL cannot be adjusted, while LV_SLIDER_TYPE_NORMAL and LV_SLIDER_TYPE_RANGE work OK.
What MCU/Processor/Board and compiler are you using?
C in general
What do you experience?
This came to me while testing the “knob only adjust” slider.
lv_obj_t *slider = lv_slider_create(btn, NULL);
lv_slider_set_range(slider, -10, 10);
lv_slider_set_type(slider, LV_SLIDER_TYPE_SYMMETRICAL);
This produces a nice slider - but it cannot be adjusted by dragging (on master branch per this date). Other types (normal, range) work as expected.
The fault seems to be in slider’s signal handler (lv_slider.c:268):
if(lv_slider_get_type(slider) == LV_SLIDER_TYPE_NORMAL) {
ext->value_to_set = &ext->bar.cur_value;
}
The condition above should include symmetrical type too.
Now, if you can confirm this as a bug, I can provide a pull request implementing the knob-only sliders plus a fix to this.