refactor(obj): remove LV_PART_TICKS and use LV_PART_ITEMS in lv_scale

This commit is contained in:
Gabor Kiss-Vamosi
2023-10-12 21:50:43 +02:00
parent d3aee1d7f6
commit bccbde0cef
13 changed files with 22 additions and 36 deletions

View File

@@ -260,7 +260,6 @@ The following predefined parts exist in LVGL:
- :cpp:enumerator:`LV_PART_KNOB`: Like a handle to grab to adjust the value
- :cpp:enumerator:`LV_PART_SELECTED`: Indicate the currently selected option or section
- :cpp:enumerator:`LV_PART_ITEMS`: Used if the widget has multiple similar elements (e.g. table cells)
- :cpp:enumerator:`LV_PART_TICKS`: Ticks on scales e.g. for a chart or meter
- :cpp:enumerator:`LV_PART_CURSOR`: Mark a specific place e.g. text area's or chart's cursor
- :cpp:enumerator:`LV_PART_CUSTOM_FIRST`: Custom parts can be added from here.

View File

@@ -183,7 +183,6 @@ The following predefined parts exist in LVGL:
- :cpp:enumerator:`LV_PART_KNOB`: Like a handle to grab to adjust a value
- :cpp:enumerator:`LV_PART_SELECTED`: Indicate the currently selected option or section
- :cpp:enumerator:`LV_PART_ITEMS`: Used if the widget has multiple similar elements (e.g. table cells)
- :cpp:enumerator:`LV_PART_TICKS`: Ticks on scales e.g. for a chart or meter
- :cpp:enumerator:`LV_PART_CURSOR`: Mark a specific place e.g. text area's or chart's cursor
- :cpp:enumerator:`LV_PART_CUSTOM_FIRST`: Custom part identifiers can be added starting from here.

View File

@@ -35,8 +35,6 @@ Parts and Styles
- :cpp:enumerator:`LV_PART_CURSOR` *Line* properties are used to style the cursors.
``width``, ``height``, ``bg_color`` and ``radius`` are used to set
the appearance of points.
- :cpp:enumerator:`LV_PART_TICKS` *Line* and *Text* style properties are used to
style the ticks
Usage
*****
@@ -263,7 +261,7 @@ Events
- :cpp:enumerator:`LV_CHART_DRAW_PART_TICK_LABEL` Used on tick lines and labels.
- ``part``: :cpp:enumerator:`LV_PART_TICKS`
- ``part``: :cpp:enumerator:`LV_PART_ITEMS`
- ``id``: axis
- ``value``: value of the tick
- ``text``: ``value`` converted to decimal or ``NULL`` for minor

View File

@@ -12,7 +12,7 @@ Parts and Styles
The scale widget is divided in the following three parts:
- :cpp:enumerator: `LV_PART_MAIN` Main line. See blue line in the example image.
- :cpp:enumerator: `LV_PART_TICKS` Minor ticks. See red minor ticks in the example image.
- :cpp:enumerator: `LV_PART_ITEMS` Minor ticks. See red minor ticks in the example image.
- :cpp:enumerator: `LV_PART_INDICATOR` Major ticks and its labels (if enabled). See pink labels and green major ticks in the example image.
![](/misc/scale.png "Scale example")
@@ -37,7 +37,7 @@ Sections
A section is the space between a minor and a major range. They can be created with :cpp:expr: `lv_scale_add_section(scale)` and it handles back an :cpp:expr: `lv_scale_section_t` pointer.
The range of the section is configured with :cpp:expr: `lv_scale_section_set_range(section, minor_range, major_range)`. The style of each of the three parts of the scale section can be set with :cpp:expr: `lv_scale_section_set_style(section, PART, style_pointer)`, where `PART` can be :cpp:enumarator: `LV_PART_MAIN`, :cpp:enumarator: `LV_PART_TICKS` or :cpp:enumarator: `LV_PART_INDICATOR`, :cpp:expr: `style_pointer` should point to a global or static :cpp:expr: `lv_style_t` variable.
The range of the section is configured with :cpp:expr: `lv_scale_section_set_range(section, minor_range, major_range)`. The style of each of the three parts of the scale section can be set with :cpp:expr: `lv_scale_section_set_style(section, PART, style_pointer)`, where `PART` can be :cpp:enumarator: `LV_PART_MAIN`, :cpp:enumarator: `LV_PART_ITEMS` or :cpp:enumarator: `LV_PART_INDICATOR`, :cpp:expr: `style_pointer` should point to a global or static :cpp:expr: `lv_style_t` variable.
For labels the following properties can be configured:
:cpp:expr: `lv_style_set_text_font`, :cpp:expr: `lv_style_set_text_color`, :cpp:expr: `lv_style_set_text_letter_space`, :cpp:expr: `lv_style_set_text_opa`.