feat(bar): reverse drawing direction of lv_bar if min > max (#4654)

Signed-off-by: wangxuedong <wangxuedong@xiaomi.com>
This commit is contained in:
xaowang96
2023-10-21 05:22:56 +08:00
committed by GitHub
parent c0356c9380
commit 8f57f12a44
14 changed files with 217 additions and 65 deletions

View File

@@ -33,7 +33,9 @@ A new value can be set by
``lv_bar_set_value(bar, new_value, LV_ANIM_ON/OFF)``. The value is
interpreted in a range (minimum and maximum values) which can be
modified with :cpp:expr:`lv_bar_set_range(bar, min, max)`. The default range is
0..100.
0..100, and the default drawing direction is from left to right in horizontal mode and
bottom to top in vertical mode. If the minimum value is greater than the maximum value, like
100..0, the drawing direction changes to the opposite direction.
The new value in :cpp:func:`lv_bar_set_value` can be set with or without an
animation depending on the last parameter (``LV_ANIM_ON/OFF``).

View File

@@ -35,6 +35,9 @@ To set an initial value use :cpp:expr:`lv_slider_set_value(slider, new_value, LV
animation time is set by the styles' ``anim_time`` property.
To specify the range (min, max values), :cpp:expr:`lv_slider_set_range(slider, min , max)` can be used.
The default range is 0..100, and the default drawing direction is from left to right in horizontal mode and
bottom to top in vertical mode. If the minimum value is greater than the maximum value, like
100..0, the drawing direction changes to the opposite direction.
Modes
-----