From d57961917e904e38d177fab4253f6077e9da9f09 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 22 Jun 2023 12:34:09 +0200 Subject: [PATCH] fix(color): Firmware update progress text stuck at device reset (#3704) * fixes #3695 flash progress * move init() to where it belongs (constructor) --- radio/src/gui/colorlcd/fullscreen_dialog.cpp | 10 ++++++++-- radio/src/gui/colorlcd/fullscreen_dialog.h | 6 +----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/radio/src/gui/colorlcd/fullscreen_dialog.cpp b/radio/src/gui/colorlcd/fullscreen_dialog.cpp index 5a56008eb..b24d50ff5 100644 --- a/radio/src/gui/colorlcd/fullscreen_dialog.cpp +++ b/radio/src/gui/colorlcd/fullscreen_dialog.cpp @@ -45,6 +45,9 @@ FullScreenDialog::FullScreenDialog( Layer::push(this); bringToTop(); + + init(); + lv_obj_add_event_cb(lvobj, FullScreenDialog::long_pressed, LV_EVENT_LONG_PRESSED, nullptr); } @@ -105,8 +108,6 @@ void FullScreenDialog::init() void FullScreenDialog::paint(BitmapBuffer * dc) { - init(); - OpenTxTheme::instance()->drawBackground(dc); dc->drawFilledRect(0, ALERT_FRAME_TOP, LCD_W, ALERT_FRAME_HEIGHT, SOLID, @@ -175,6 +176,11 @@ void FullScreenDialog::deleteLater(bool detach, bool trash) } } +void FullScreenDialog::setMessage(std::string text) +{ + messageLabel->setText(text); +} + static void run_ui_manually() { checkBacklight(); diff --git a/radio/src/gui/colorlcd/fullscreen_dialog.h b/radio/src/gui/colorlcd/fullscreen_dialog.h index 759d53823..7f7a1e5ab 100644 --- a/radio/src/gui/colorlcd/fullscreen_dialog.h +++ b/radio/src/gui/colorlcd/fullscreen_dialog.h @@ -48,11 +48,7 @@ class FullScreenDialog : public Window } #endif - void setMessage(std::string text) - { - message = std::move(text); - invalidate(); - } + void setMessage(std::string text); void paint(BitmapBuffer * dc) override;