mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
lv_list: lv_list_set_element_text_roll() added
This commit is contained in:
parent
712feae198
commit
f3f7664300
@ -229,6 +229,25 @@ void lv_list_set_sb_out(lv_obj_t * list, bool out)
|
||||
ext->sb_out = out == false ? 0 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable or disable the text rolling on a list element
|
||||
* @param liste pinter to list element
|
||||
* @param en true: enable text scrolling, false: disable text scrolling
|
||||
*/
|
||||
void lv_list_set_element_text_roll(lv_obj_t * liste, bool en)
|
||||
{
|
||||
/*The last child is the label*/
|
||||
lv_obj_t * label = lv_obj_get_child(liste, NULL);
|
||||
if(en == false) {
|
||||
lv_label_set_long_mode(label, LV_LABEL_LONG_DOTS);
|
||||
} else {
|
||||
lv_obj_set_width(label, liste->cords.x2 - label->cords.x1);
|
||||
lv_label_set_long_mode(label, LV_LABEL_LONG_ROLL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set styles of the list elements of a list in each state
|
||||
* @param list pointer to list object
|
||||
|
@ -103,6 +103,13 @@ void lv_list_down(lv_obj_t * list);
|
||||
*/
|
||||
void lv_list_set_sb_out(lv_obj_t * list, bool out);
|
||||
|
||||
/**
|
||||
* Enable or disable the text rolling on a list element
|
||||
* @param liste pinter to list element
|
||||
* @param en true: enable text scrolling, false: disable text scrolling
|
||||
*/
|
||||
void lv_list_set_element_text_roll(lv_obj_t * liste, bool en);
|
||||
|
||||
/**
|
||||
* Set styles of the list elements of a list in each state
|
||||
* @param list pointer to list object
|
||||
|
Loading…
x
Reference in New Issue
Block a user