chore(label) make selection interface naming consistent (#3595)
This commit is contained in:
@@ -216,7 +216,7 @@ void lv_label_set_recolor(lv_obj_t * obj, bool en)
|
|||||||
lv_label_refr_text(obj);
|
lv_label_refr_text(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_label_set_text_sel_start(lv_obj_t * obj, uint32_t index)
|
void lv_label_set_text_selection_start(lv_obj_t * obj, uint32_t index)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ void lv_label_set_text_sel_start(lv_obj_t * obj, uint32_t index)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_label_set_text_sel_end(lv_obj_t * obj, uint32_t index)
|
void lv_label_set_text_selection_end(lv_obj_t * obj, uint32_t index)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
|
||||||
|
|||||||
@@ -140,14 +140,14 @@ void lv_label_set_recolor(lv_obj_t * obj, bool en);
|
|||||||
* @param obj pointer to a label object
|
* @param obj pointer to a label object
|
||||||
* @param index character index from where selection should start. `LV_LABEL_TEXT_SELECTION_OFF` for no selection
|
* @param index character index from where selection should start. `LV_LABEL_TEXT_SELECTION_OFF` for no selection
|
||||||
*/
|
*/
|
||||||
void lv_label_set_text_sel_start(lv_obj_t * obj, uint32_t index);
|
void lv_label_set_text_selection_start(lv_obj_t * obj, uint32_t index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set where text selection should end
|
* Set where text selection should end
|
||||||
* @param obj pointer to a label object
|
* @param obj pointer to a label object
|
||||||
* @param index character index where selection should end. `LV_LABEL_TEXT_SELECTION_OFF` for no selection
|
* @param index character index where selection should end. `LV_LABEL_TEXT_SELECTION_OFF` for no selection
|
||||||
*/
|
*/
|
||||||
void lv_label_set_text_sel_end(lv_obj_t * obj, uint32_t index);
|
void lv_label_set_text_selection_end(lv_obj_t * obj, uint32_t index);
|
||||||
|
|
||||||
/*=====================
|
/*=====================
|
||||||
* Getter functions
|
* Getter functions
|
||||||
|
|||||||
@@ -730,8 +730,8 @@ void lv_textarea_clear_selection(lv_obj_t * obj)
|
|||||||
|
|
||||||
if(lv_label_get_text_selection_start(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL ||
|
if(lv_label_get_text_selection_start(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL ||
|
||||||
lv_label_get_text_selection_end(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL) {
|
lv_label_get_text_selection_end(ta->label) != LV_DRAW_LABEL_NO_TXT_SEL) {
|
||||||
lv_label_set_text_sel_start(ta->label, LV_DRAW_LABEL_NO_TXT_SEL);
|
lv_label_set_text_selection_start(ta->label, LV_DRAW_LABEL_NO_TXT_SEL);
|
||||||
lv_label_set_text_sel_end(ta->label, LV_DRAW_LABEL_NO_TXT_SEL);
|
lv_label_set_text_selection_end(ta->label, LV_DRAW_LABEL_NO_TXT_SEL);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LV_UNUSED(obj); /*Unused*/
|
LV_UNUSED(obj); /*Unused*/
|
||||||
|
|||||||
@@ -567,8 +567,8 @@ void test_label_text_selection(void)
|
|||||||
const uint32_t selection_start = 0;
|
const uint32_t selection_start = 0;
|
||||||
const uint32_t selection_end = strlen(lv_label_get_text(label)) - 1;
|
const uint32_t selection_end = strlen(lv_label_get_text(label)) - 1;
|
||||||
|
|
||||||
lv_label_set_text_sel_start(label, selection_start);
|
lv_label_set_text_selection_start(label, selection_start);
|
||||||
lv_label_set_text_sel_end(label, selection_end);
|
lv_label_set_text_selection_end(label, selection_end);
|
||||||
|
|
||||||
uint32_t start = lv_label_get_text_selection_start(label);
|
uint32_t start = lv_label_get_text_selection_start(label);
|
||||||
uint32_t end = lv_label_get_text_selection_end(label);
|
uint32_t end = lv_label_get_text_selection_end(label);
|
||||||
|
|||||||
Reference in New Issue
Block a user