Wrong focus after ConfirmationDialog closed

This commit is contained in:
Bertrand Songis
2019-10-28 17:30:22 +01:00
parent 288e3ce545
commit 4a465d68fc
+2 -2
View File
@@ -21,7 +21,7 @@
#include "confirm_dialog.h"
#include "static.h"
ConfirmDialog::ConfirmDialog(const char *title, const char *message, std::function<void(void)> confirmHandler) :
ConfirmDialog::ConfirmDialog(const char * title, const char * message, std::function<void(void)> confirmHandler) :
Dialog(title, {50, 73, LCD_W - 100, LCD_H - 146}),
confirmHandler(std::move(confirmHandler))
{
@@ -34,8 +34,8 @@ void ConfirmDialog::onEvent(event_t event)
TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString().c_str(), event);
if (event == EVT_KEY_BREAK(KEY_ENTER)) {
deleteLater(); // this restore the focus (it can be changed then in confirmHandler)
confirmHandler();
deleteLater();
}
else if (event == EVT_KEY_BREAK(KEY_EXIT)) {
deleteLater();