mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-24 00:07:03 +08:00
feat(scale): set tick drawing order (#6185)
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
@@ -33,6 +33,19 @@ Set ranges
|
||||
|
||||
The minor and major range (values of each tick) are configured with :cpp:expr:`lv_scale_set_range(scale, minor_range, major_range)`.
|
||||
|
||||
Tick drawing order
|
||||
------------------
|
||||
You can set the drawing of the ticks on top of the main line with :cpp:expr:`lv_scale_set_draw_ticks_on_top(scale, true)`. The default
|
||||
drawing order is below the main line.
|
||||
|
||||
This is a scale with the ticks being drawn below of the main line (default):
|
||||
|
||||
.. image:: /misc/scale_ticks_below.png
|
||||
|
||||
This is an scale with the ticks being drawn at the top of the main line:
|
||||
|
||||
.. image:: /misc/scale_ticks_on_top.png
|
||||
|
||||
Configure ticks
|
||||
---------------
|
||||
|
||||
|
||||
+215
-191
File diff suppressed because it is too large
Load Diff
@@ -82,6 +82,7 @@ typedef struct {
|
||||
uint32_t major_tick_every : 15;
|
||||
uint32_t label_enabled : 1;
|
||||
uint32_t post_draw : 1;
|
||||
uint32_t draw_ticks_on_top : 1;
|
||||
/* Round scale */
|
||||
uint32_t angle_range;
|
||||
int32_t rotation;
|
||||
@@ -199,6 +200,13 @@ void lv_scale_set_text_src(lv_obj_t * obj, const char * txt_src[]);
|
||||
*/
|
||||
void lv_scale_set_post_draw(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Draw the scale ticks on top of all parts
|
||||
* @param obj pointer to a scale object
|
||||
* @param en true: enable draw ticks on top of all parts
|
||||
*/
|
||||
void lv_scale_set_draw_ticks_on_top(lv_obj_t * obj, bool en);
|
||||
|
||||
/**
|
||||
* Add a section to the given scale
|
||||
* @param obj pointer to a scale object
|
||||
|
||||
Reference in New Issue
Block a user