1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

Cleanup LV_SIGNAL_GET_TYPE implementations (#2127)

Remove dead code in lv_label and lv_spinbox, there is already lv_obj_handle_get_type_signal() call higher up.
Change lv_led to use lv_obj_handle_get_type_signal() like other widgets do.
This commit is contained in:
Petteri Aimonen 2021-03-08 16:01:59 +02:00 committed by GitHub
parent a4c33bb16e
commit 607e02e52a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 24 deletions

View File

@ -1421,14 +1421,6 @@ static lv_res_t lv_label_signal(lv_obj_t * label, lv_signal_t sign, void * param
if(ext->static_txt == 0) lv_label_set_text(label, NULL);
#endif
}
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_label";
}
return res;
}

View File

@ -237,14 +237,7 @@ static lv_res_t lv_led_signal(lv_obj_t * led, lv_signal_t sign, void * param)
res = ancestor_signal(led, sign, param);
if(res != LV_RES_OK) return res;
if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_led";
}
if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);
return res;
}

View File

@ -399,14 +399,6 @@ static lv_res_t lv_spinbox_signal(lv_obj_t * spinbox, lv_signal_t sign, void * p
if(sign == LV_SIGNAL_CLEANUP) {
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
}
else if(sign == LV_SIGNAL_GET_TYPE) {
lv_obj_type_t * buf = param;
uint8_t i;
for(i = 0; i < LV_MAX_ANCESTOR_NUM - 1; i++) { /*Find the last set data*/
if(buf->type[i] == NULL) break;
}
buf->type[i] = "lv_spinbox";
}
else if(sign == LV_SIGNAL_RELEASED) {
/*If released with an ENCODER then move to the next digit*/
lv_spinbox_ext_t * ext = lv_obj_get_ext_attr(spinbox);