* slider: Refactor LV_SLIDER_KNOB_COORD and draw_knob
The `hor` parameter of this macro was always true, ending up always using the
left side of the ternary operator, with this refactor we eliminate the `hor`
parameter and remove the ternary operator it was used for.
This macro is only used in the `draw_knob` event handler, so it helps with its
initial cleanup.
* test(slider): Test documented default properties
* test(slider): Tests for LV_EVENT_KEY with valid and invalid keys
* feat(slider): Add helper to know if slider is horizontal
* chore(slider): Cleanup LV_EVENT_PRESSING handler
Reduce scope of variables where possible and use LV_CLAMP
* chore(slider): Cleanup draw_knob
* test(slider): Add tests for LV_EVENT_RELEASED
* test(slider): Add note about left_knob_focus
* test(slider): Initial test for hit test
* test(slider): Add tests for different slider modes
* chore(slider): cleanup draw_knob
* chore(slider): Cleanup position_knob
* test(slider): Move group configuration to setUp
* test(slider): Refactor tests with feedback
* add test_ranged_mode_adjust_with_encoder
* code formatting
* tests(slider): Remove direct usages of left_knob_focus
* test(slider): Remove unused variable
* Revert "test(slider): Refactor tests with feedback"
This reverts commit b274f829ecd83c894569b6f0535c7edebce5cbc9.
* test(slider): Add missing variable
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(line): Test y invert field
* test(line): Validate documented default values
* test(line): Assert line is not clickable after construction
* test(line): Test line size calculation
* chore(line): Refactor LV_EVENT_GET_SELF_SIZE handling
Return early when no point_array is set or point_num is 0
* chore(line): Cleanup LV_EVENT_DRAW_MAIN handling
Reduce scope of point variables
* test(line): Clean screen on tearDown
* test(line): Add initial test for extra draw size calculation
* test(line): Fix extra draw size test
* feat(label): added animation style property to apply it to circular scrolling animation of label widget
Added an animation style property to be used as animation template for different use cases in different widgets.
This commit implements using this property to set the start and repeat delay of the circular scrolling animation of the label widget.
Closes#3097
* fix(label): changed animation style property's var_type to `const lv_anim_t *`
* example(label): added example showing how to customize circular scrolling animation
* chore(label): ran code-format.py and added missing function prototype to lv_example_widgets.h
* test(table): Replicate issue when reducing table cells
See #3120 for report
* test(table): Cell reduction test without use after free
Set the row count to 1 to be able to have a passing test, now we can track
down the real bug, which is triggered when having more than 1 row in the table.
* test(table): Add failing test for cell reduction
This test currently triggers the use after free bug
* chore(table): No-op when new and current row and columns counts are equal
* chore(table): Clean up lv_table_set_col_cnt
* chore(table): Add comments to get_row_height
* chore(table): Minor format cleanup and comment of cell_data layout
* fix ASAN arror
* minor fixes
* chore(table): Restore comments to get_row_height
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* widgets: make dependencies internal handling consistent when using Kconfig
* scripts/lv_conf_internal_gen.py: fix issue with widget with dependencies
* scripts/lv_conf_internal_gen.py: allow to call it from other directory
* test(textarea): Password mode
* test(textarea): label style with one line enabled
* test(textarea): Cursor click pos
* chore(textarea): Move auto hide to helper
* test(textarea): Placeholder text
* test(textarea): Default properties values
* test(textarea): Remove assert from one line test
* tests(textarea): Remove unused variables
* feat/textarea: Add and use is_valid_but_non_printable_char
* chore/textarea: General cleanup
* test(textarea): Accepted chars
* Update src/widgets/lv_textarea.c
* test(textarea): Assert text is empty after widget creation
* test(textarea): Update test for label style with one line enabled
* test(textarea): Add default text helper and use it
* test(textarea): Ignore line break chars in one line mode
* textarea: Check for line break chars sooner when adding char
* textarea: Start refactor of insert_handler
* textarea: Add comments to insert_handler
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(table): Happy path test for set_cell_value
* table: Abstract char configuration on set_cell_value
Abstract bytes to allocate calculation and txt copying
* table: Add missing &
* table: Update helper names
* test(table): Add test for column increasing when setting a formatted cell value
* table: Increase table columns when needed
* test(table): Fix test_table_should_grow_columns_automatically_when_setting_formatted_cell_value
* table: Fix code formatting
* test(table): Add test for cell ctrl
* table: Refactor draw_main low hanging fruits
* lv_table: Initial refactor of get_row_height
Mostly early breaks on loops and reducing variable scope where possible
* lv_table: Initial refactor of refr_size
Adding const wherever is possible
* lv_table: Further cleanup get_row_height
* lv_table: Cleanup loop in draw_main
* lv_table: Fix -Werror=shadow compilation error
* test(table): Tests for cell ctrl clearance
* lv_table: Rename index to idx
* lv_table: Use helper to know if cell is empty
* test(table): Comment assumptions to column grow test
* test(table): Row height with multi line cell value
* test(table): Wrap on long texts and increase row height
* add rendering test
* fix warnings
* fix out of bounds indexig
* fix rendering test
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
* test(bar) Add test for docummented default attributes
* test(bar) Update test for docummented default attributes
* test(bar): Indicator width tracks value
* test(bar) Calculate bar indicator width based on its style
Take padding, max value and bar value into consideraion
* test(bar) Indicator area gets smaller when increasing padding in LV_PART_MAIN style
* test(bar) Start value changes only when in range mode
* docs(bar): Add missing MODE to symbols
* test(bar) Start value should be smaller than current value
* test(bar): Test current value truncation to max and min value
* bar: Check bar mode in lv_bar_set_start_value
bar start_value can be changed only when bar is in LV_BAR_MODE_RANGE mode.
Return early when it's not.
* test(bar): Fix width calculation test
* bar: Initialize indic_area in constructor
* test(bar): Refactor indicator coordinate update test
* test(bar): Indicator negative value in symmetrical mode
* test(bar): Fix base direction
* test(bar): Indicator coord test for RTL base dir
* feat(obj scroll):subdivide LV_OBJ_FLAG_SCROLL_CHAIN into ...CHAIN_HOR and ...CHAIN_VER
* feat(roller):open the horizontal scroll chain
* chore(docs):improve the description of scroll chain
The issue is related to the case when the indicator is short but the main part (bg) clips it with a larger radius.
In this case this indicaotr might have a strange shape, like
_
/ |
| |
\_|
We can't draw a shadow like this, so the indicator has to be et least a square,
to be sure it's not clipped to an ugly shape.
The previous code considered the bg radius to decide whether to draw shadow on short indicators or not.
However if the indicator's radius should be considered, becuse if its area at least a square
we can already draw shadows.
* Fixed inconsistent header for find_track_end()
* Fixed inconsistent header for lv_tileview_add_tile()
* Made ptr const in lv_tlsf_free()
* Made ptr const in lv_tlsf_free()
* Corrected lv_bar_set_value() calls
* Corrected use of bool for lv_anim_enable_t
* Fixed uninitialised variable for performance monitor
* Undo fix
* test(switch): Add test file and state at creation test
* test(switch): Event handler called only once per click
* test(switch): Add test state change when event bubbling is enabled
* test(switch): Cleanup event bubbling test
* tests(switch): Update memory test and add basic animation test
* test(switch) Add helper to click on switch
* test(switch) Add basic test for knob size calculation
* misc(switch) Replace switch knob rounding error magic number with define
* test(switch) Improve animation test
Properly wait for 50ms after clicking on the switch using lv_test_indev_wait and also assert on switch state after the first and second clicks
* test(switch) cleanup
* misc(switch) Cleanup
* switch: Expose _LV_SWITCH_KNOB_EXT_AREA_CORRECTION value
So we can use it when testing extra draw size
* fix(format): run code-format.sh
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
* fix(astyle): add the 3rd party source file to exclude list
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>