From 73e036bba748e8677f219f573cba5f82c4158a17 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 24 Sep 2021 13:03:13 +0200 Subject: [PATCH] fix(msgbox) prevent the buttons being wider than the msbgox --- src/extra/widgets/msgbox/lv_msgbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extra/widgets/msgbox/lv_msgbox.c b/src/extra/widgets/msgbox/lv_msgbox.c index 96a8aab45..d8a6817e2 100644 --- a/src/extra/widgets/msgbox/lv_msgbox.c +++ b/src/extra/widgets/msgbox/lv_msgbox.c @@ -128,6 +128,7 @@ lv_obj_t * lv_msgbox_create(lv_obj_t * parent, const char * title, const char * const lv_font_t * font = lv_obj_get_style_text_font(mbox->btns, LV_PART_ITEMS); lv_coord_t btn_h = lv_font_get_line_height(font) + LV_DPI_DEF / 10; lv_obj_set_size(mbox->btns, btn_cnt * (2 * LV_DPI_DEF / 3), btn_h); + lv_obj_set_style_max_width(mbox->btns, lv_pct(100), 0); lv_obj_add_flag(mbox->btns, LV_OBJ_FLAG_EVENT_BUBBLE); /*To see the event directly on the message box*/ }