remove duplicated lines from lv_tabview_add_tab

This commit is contained in:
Gabor Kiss-Vamosi
2020-07-24 16:16:18 +02:00
parent 00e93a5d30
commit f30dc5d186
2 changed files with 1 additions and 14 deletions

View File

@@ -230,20 +230,6 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * tabview, const char * name)
ext->tab_cnt++;
switch(ext->btns_pos) {
case LV_TABVIEW_TAB_POS_TOP:
case LV_TABVIEW_TAB_POS_BOTTOM:
ext->tab_name_ptr = lv_mem_realloc((void *)ext->tab_name_ptr, sizeof(char *) * (ext->tab_cnt + 1));
break;
case LV_TABVIEW_TAB_POS_LEFT:
case LV_TABVIEW_TAB_POS_RIGHT:
ext->tab_name_ptr = lv_mem_realloc((void *)ext->tab_name_ptr, sizeof(char *) * (ext->tab_cnt * 2));
break;
}
LV_ASSERT_MEM(ext->tab_name_ptr);
if(ext->tab_name_ptr == NULL) return NULL;
/* FIXME: It is not possible yet to switch tab button position from/to top/bottom from/to left/right at runtime.
* Method: clean extra \n when switch from LV_TABVIEW_BTNS_POS_LEFT or LV_TABVIEW_BTNS_POS_RIGHT
* to LV_TABVIEW_BTNS_POS_TOP or LV_TABVIEW_BTNS_POS_BOTTOM.