feat(msgbox): add support for formatted text (#9583)

Signed-off-by: James Roy <rruuaanng@outlook.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
RUANG (James Roy)
2026-02-03 23:43:34 +08:00
committed by GitHub
parent 0a6de47190
commit 043991b59f
4 changed files with 31 additions and 0 deletions
@@ -68,6 +68,7 @@ void test_msgbox_creation_successful_modal(void)
msgbox = lv_msgbox_create(NULL);
lv_msgbox_add_title(msgbox, "The title");
lv_msgbox_add_text(msgbox, "The text");
lv_msgbox_add_text_fmt(msgbox, "The %s text", "fmt");
lv_msgbox_add_footer_button(msgbox, "Apply");
lv_msgbox_add_footer_button(msgbox, "Close");
lv_msgbox_add_header_button(msgbox, LV_SYMBOL_AUDIO);
@@ -87,6 +88,7 @@ void test_msgbox_get_title(void)
msgbox = lv_msgbox_create(active_screen);
lv_msgbox_add_title(msgbox, "The title");
lv_msgbox_add_text(msgbox, "The text");
lv_msgbox_add_text_fmt(msgbox, "The %s text", "fmt");
lv_msgbox_add_footer_button(msgbox, "Apply");
lv_msgbox_add_footer_button(msgbox, "Close");
lv_msgbox_add_header_button(msgbox, LV_SYMBOL_AUDIO);
@@ -109,6 +111,7 @@ void test_msgbox_close(void)
{
msgbox = lv_msgbox_create(active_screen);
lv_msgbox_add_text(msgbox, "The text");
lv_msgbox_add_text_fmt(msgbox, "The %s text", "fmt");
lv_msgbox_close(msgbox);
@@ -120,6 +123,7 @@ void test_msgbox_close_modal(void)
{
msgbox = lv_msgbox_create(NULL);
lv_msgbox_add_text(msgbox, "The text");
lv_msgbox_add_text_fmt(msgbox, "The %s text", "fmt");
lv_msgbox_close(msgbox);
@@ -131,6 +135,7 @@ void test_msgbox_close_async(void)
{
msgbox = lv_msgbox_create(active_screen);
lv_msgbox_add_text(msgbox, "The text");
lv_msgbox_add_text_fmt(msgbox, "The %s text", "fmt");
// lv_msgbox_close deletes the message box
TEST_ASSERT_NOT_NULL(msgbox);
@@ -140,6 +145,7 @@ void test_msgbox_close_async_modal(void)
{
msgbox = lv_msgbox_create(NULL);
lv_msgbox_add_text(msgbox, "The text");
lv_msgbox_add_text_fmt(msgbox, "The %s text", "fmt");
// lv_msgbox_close deletes the message box
TEST_ASSERT_NOT_NULL(msgbox);
@@ -151,6 +157,7 @@ void test_msgbox_content_auto_height(void)
msgbox = lv_msgbox_create(NULL);
lv_msgbox_add_title(msgbox, "The title");
lv_msgbox_add_text(msgbox, "The text");
lv_msgbox_add_text_fmt(msgbox, "The %s text", "fmt");
lv_msgbox_add_footer_button(msgbox, "Apply");
lv_msgbox_add_footer_button(msgbox, "Close");
lv_msgbox_add_header_button(msgbox, LV_SYMBOL_AUDIO);