feat(slider): consider ext_click_area on the knob with LV_OBJ_FLAG_ADV_HITTEST

This commit is contained in:
Gabor Kiss-Vamosi
2022-01-08 13:48:35 +01:00
parent 3d1ea607f2
commit 9d3fb41896
2 changed files with 12 additions and 3 deletions

View File

@@ -33,6 +33,8 @@ The mode can be changed with `lv_slider_set_mode(slider, LV_SLIDER_MODE_...)`
Normally, the slider can be adjusted either by dragging the knob, or by clicking on the slider bar.
In the latter case the knob moves to the point clicked and slider value changes accordingly. In some cases it is desirable to set the slider to react on dragging the knob only. This feature is enabled by adding the `LV_OBJ_FLAG_ADV_HITTEST`: `lv_obj_add_flag(slider, LV_OBJ_FLAG_ADV_HITTEST)`.
The extended click area (set by `lv_obj_set_ext_click_area(slider, value)`) increases to knob's click area.
## Events
- `LV_EVENT_VALUE_CHANGED` Sent while the slider is being dragged or changed with keys.
The event is sent continuously while the slider is dragged and once when released. Use `lv_slider_is_dragged` to determine whether the Slider is still being dragged or has just been released.