fix(msgbox) return the correct pointer from lv_msgbox_get_text

fixes #2436
This commit is contained in:
Gabor Kiss-Vamosi
2021-08-06 19:20:35 +02:00
parent a958c29af7
commit 50ea6fb3fe

View File

@@ -120,7 +120,9 @@ lv_obj_t * lv_msgbox_get_close_btn(lv_obj_t * mbox)
lv_obj_t * lv_msgbox_get_text(lv_obj_t * mbox)
{
return lv_obj_get_child(mbox, lv_obj_get_child_cnt(mbox) - 2);
lv_obj_t * guess = lv_obj_get_child(mbox, 1); /*Can be the close button*/
if(lv_obj_get_class(guess) == &lv_btn_class) guess = lv_obj_get_child(mbox, 2);
return guess;
}
lv_obj_t * lv_msgbox_get_btns(lv_obj_t * mbox)