mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
28 lines
834 B
C
28 lines
834 B
C
|
#include "../../lv_examples.h"
|
||
|
#if LV_USE_SCALE && LV_BUILD_EXAMPLES
|
||
|
|
||
|
/**
|
||
|
* A simple horizontal scale with transforms
|
||
|
*/
|
||
|
void lv_example_scale_9(void)
|
||
|
{
|
||
|
lv_obj_t * scale = lv_scale_create(lv_screen_active());
|
||
|
lv_obj_set_size(scale, 200, 100);
|
||
|
lv_scale_set_mode(scale, LV_SCALE_MODE_HORIZONTAL_BOTTOM);
|
||
|
lv_obj_center(scale);
|
||
|
|
||
|
lv_scale_set_label_show(scale, true);
|
||
|
lv_obj_set_style_transform_rotation(scale, 450, LV_PART_INDICATOR);
|
||
|
lv_obj_set_style_length(scale, 30, LV_PART_INDICATOR);
|
||
|
lv_obj_set_style_translate_x(scale, 5, LV_PART_INDICATOR);
|
||
|
|
||
|
lv_scale_set_total_tick_count(scale, 31);
|
||
|
lv_scale_set_major_tick_every(scale, 5);
|
||
|
|
||
|
lv_obj_set_style_length(scale, 5, LV_PART_ITEMS);
|
||
|
lv_obj_set_style_length(scale, 10, LV_PART_INDICATOR);
|
||
|
lv_scale_set_range(scale, 10, 40);
|
||
|
}
|
||
|
|
||
|
#endif
|