File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,20 @@ void PopupMessage::Create() {
17
17
lv_obj_set_style_local_bg_opa (btnPopup, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_60);
18
18
lv_obj_t * lblMessage = lv_label_create (btnPopup, nullptr );
19
19
lv_label_set_text_static (lblMessage, message);
20
- lv_obj_set_hidden (btnPopup, true );
20
+ lv_obj_set_hidden (btnPopup, isHidden );
21
21
}
22
22
23
23
void PopupMessage::SetHidden (bool hidden) {
24
- NRF_LOG_INFO (" PopupMessage::SetHidden - hidden %d, ptr: %p" , hidden, btnPopup);
25
24
if (isHidden == hidden) {
26
25
return ;
27
26
}
28
27
isHidden = hidden;
28
+ // create/delete on demand
29
29
if (btnPopup == nullptr && !isHidden) {
30
30
Create ();
31
31
} else if (btnPopup != nullptr ) {
32
- lv_obj_set_hidden (btnPopup, isHidden);
32
+ lv_obj_del (btnPopup);
33
+ btnPopup = nullptr ;
33
34
}
34
35
}
35
36
You can’t perform that action at this time.
0 commit comments