From 949493dd45ee91dcd6b728a23112fbb296b4a879 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Thu, 29 Apr 2021 20:34:23 +0200 Subject: [PATCH] Add lv_obj_set_auto_realign to msgbox --- src/hasp/hasp_object.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hasp/hasp_object.cpp b/src/hasp/hasp_object.cpp index e09504df..52b7fee2 100644 --- a/src/hasp/hasp_object.cpp +++ b/src/hasp/hasp_object.cpp @@ -23,6 +23,8 @@ #include "hasplib.h" const char** btnmatrix_default_map; // memory pointer to lvgl default btnmatrix map +const char* msgbox_default_map[] = {"OK" + ""}; // memory pointer to hasp default msgbox map // ##################### Object Finders ######################################################## @@ -702,8 +704,9 @@ void hasp_new_object(const JsonObject& config, uint8_t& saved_page_id) obj = lv_msgbox_create(parent_obj, NULL); if(obj) { lv_obj_align(obj, NULL, LV_ALIGN_CENTER, 0, 0); + lv_obj_set_auto_realign(obj, true); lv_obj_set_event_cb(obj, msgbox_event_handler); - if(btnmatrix_default_map) lv_msgbox_add_btns(obj, btnmatrix_default_map); + // if(msgbox_default_map) lv_msgbox_add_btns(obj, msgbox_default_map); obj->user_data.objid = LV_HASP_MSGBOX; } break;