Rename btn_single_selected_mode to single_mode
This commit is contained in:
@@ -90,7 +90,7 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
|
|||||||
ext->styles_btn[LV_BTN_STATE_TGL_PR] = &lv_style_btn_tgl_pr;
|
ext->styles_btn[LV_BTN_STATE_TGL_PR] = &lv_style_btn_tgl_pr;
|
||||||
ext->styles_btn[LV_BTN_STATE_INA] = &lv_style_btn_ina;
|
ext->styles_btn[LV_BTN_STATE_INA] = &lv_style_btn_ina;
|
||||||
ext->anim_time = LV_LIST_FOCUS_TIME;
|
ext->anim_time = LV_LIST_FOCUS_TIME;
|
||||||
ext->single_selected_mode = false;
|
ext->single_mode = false;
|
||||||
|
|
||||||
#if USE_LV_GROUP
|
#if USE_LV_GROUP
|
||||||
ext->last_sel = NULL;
|
ext->last_sel = NULL;
|
||||||
@@ -264,11 +264,11 @@ bool lv_list_remove(const lv_obj_t * list, uint32_t index)
|
|||||||
* @param list pointer to the currently pressed list object
|
* @param list pointer to the currently pressed list object
|
||||||
* @param mode, enable(true)/disable(false) single selected mode.
|
* @param mode, enable(true)/disable(false) single selected mode.
|
||||||
*/
|
*/
|
||||||
void lv_list_set_btn_single_selected_mode(lv_obj_t *list, bool mode)
|
void lv_list_set_single_mode(lv_obj_t *list, bool mode)
|
||||||
{
|
{
|
||||||
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
||||||
|
|
||||||
ext->single_selected_mode = mode;
|
ext->single_mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_LV_GROUP
|
#if USE_LV_GROUP
|
||||||
@@ -387,11 +387,11 @@ void lv_list_set_style(lv_obj_t * list, lv_list_style_t type, lv_style_t * style
|
|||||||
* Get single button selected mode.
|
* Get single button selected mode.
|
||||||
* @param list pointer to the currently pressed list object.
|
* @param list pointer to the currently pressed list object.
|
||||||
*/
|
*/
|
||||||
bool lv_list_get_btn_single_selected_mode(lv_obj_t *list)
|
bool lv_list_get_single_mode(lv_obj_t *list)
|
||||||
{
|
{
|
||||||
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
|
||||||
|
|
||||||
return (ext->single_selected_mode);
|
return (ext->single_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -885,7 +885,7 @@ static lv_res_t lv_list_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * para
|
|||||||
* to mark it as selected (pressed state)*/
|
* to mark it as selected (pressed state)*/
|
||||||
last_clicked_btn = btn;
|
last_clicked_btn = btn;
|
||||||
#endif
|
#endif
|
||||||
if(lv_indev_is_dragging(lv_indev_get_act()) == false && ext->single_selected_mode)
|
if(lv_indev_is_dragging(lv_indev_get_act()) == false && ext->single_mode)
|
||||||
{
|
{
|
||||||
lv_list_btn_single_selected(btn);
|
lv_list_btn_single_selected(btn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ typedef struct
|
|||||||
lv_style_t *styles_btn[LV_BTN_STATE_NUM]; /*Styles of the list element buttons*/
|
lv_style_t *styles_btn[LV_BTN_STATE_NUM]; /*Styles of the list element buttons*/
|
||||||
lv_style_t *style_img; /*Style of the list element images on buttons*/
|
lv_style_t *style_img; /*Style of the list element images on buttons*/
|
||||||
uint32_t size; /*the number of items(buttons) in the list*/
|
uint32_t size; /*the number of items(buttons) in the list*/
|
||||||
bool single_selected_mode; /* whether single selected mode is enabled */
|
bool single_mode; /* whether single selected mode is enabled */
|
||||||
#if USE_LV_GROUP
|
#if USE_LV_GROUP
|
||||||
lv_obj_t * last_sel; /* Last btn selected */
|
lv_obj_t * last_sel; /* Last btn selected */
|
||||||
lv_obj_t * selected_btn;
|
lv_obj_t * selected_btn;
|
||||||
@@ -127,7 +127,7 @@ bool lv_list_remove(const lv_obj_t * list, uint32_t index);
|
|||||||
* @param list pointer to the currently pressed list object
|
* @param list pointer to the currently pressed list object
|
||||||
* @param mode, enable(true)/disable(false) single selected mode.
|
* @param mode, enable(true)/disable(false) single selected mode.
|
||||||
*/
|
*/
|
||||||
void lv_list_set_btn_single_selected_mode(lv_obj_t *list, bool mode);
|
void lv_list_set_single_mode(lv_obj_t *list, bool mode);
|
||||||
|
|
||||||
#if USE_LV_GROUP
|
#if USE_LV_GROUP
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ void lv_list_set_style(lv_obj_t *list, lv_list_style_t type, lv_style_t *style);
|
|||||||
* Get single button selected mode.
|
* Get single button selected mode.
|
||||||
* @param list pointer to the currently pressed list object.
|
* @param list pointer to the currently pressed list object.
|
||||||
*/
|
*/
|
||||||
bool lv_list_get_btn_single_selected_mode(lv_obj_t *list);
|
bool lv_list_get_single_mode(lv_obj_t *list);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the text of a list element
|
* Get the text of a list element
|
||||||
|
|||||||
Reference in New Issue
Block a user