Dismiss msgbox only when a button was pressed

This commit is contained in:
fvanroie 2021-04-28 03:28:30 +02:00
parent 6770c57c08
commit 03ad5e4159

View File

@ -509,6 +509,7 @@ void msgbox_event_handler(lv_obj_t* obj, lv_event_t event)
if(val != LV_BTNMATRIX_BTN_NONE) { if(val != LV_BTNMATRIX_BTN_NONE) {
const char* txt = lv_msgbox_get_active_btn_text(obj); const char* txt = lv_msgbox_get_active_btn_text(obj);
strncpy(buffer, txt, sizeof(buffer)); strncpy(buffer, txt, sizeof(buffer));
if(hasp_event_id == HASP_EVENT_UP || hasp_event_id == HASP_EVENT_RELEASE) lv_msgbox_start_auto_close(obj, 0);
} else { } else {
buffer[0] = 0; // empty string buffer[0] = 0; // empty string
} }
@ -518,8 +519,6 @@ void msgbox_event_handler(lv_obj_t* obj, lv_event_t event)
last_value_sent = val; last_value_sent = val;
event_object_selection_changed(obj, hasp_event_id, val, buffer); event_object_selection_changed(obj, hasp_event_id, val, buffer);
// if(max > 0) dispatch_normalized_group_value(obj->user_data.groupid, obj, val, 0, max); // if(max > 0) dispatch_normalized_group_value(obj->user_data.groupid, obj, val, 0, max);
if(hasp_event_id == HASP_EVENT_UP || hasp_event_id == HASP_EVENT_RELEASE) lv_msgbox_start_auto_close(obj, 0);
} }
/** /**