diff --git a/src/gui/screen_blue_error.cpp b/src/gui/screen_blue_error.cpp index 49526559d4..ac5999eba4 100644 --- a/src/gui/screen_blue_error.cpp +++ b/src/gui/screen_blue_error.cpp @@ -10,8 +10,12 @@ using namespace crash_dump; +static const constexpr Rect16 fw_version_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(30, ScreenBlueError::fw_line_top, display::GetW() - 30, 20) : Rect16(6, 295, display::GetW() - 6, 13); +static const constexpr Rect16 header_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(14, 10, 240, GuiDefaults::HeaderHeight - 10) : GuiDefaults::RectHeader; +static const constexpr Rect16 title_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(30, 44, display::GetW() - 60, 20) : Rect16(13, 12, display::GetW() - 26, 20); + ScreenBlueError::ScreenBlueError() - : AddSuperWindow() + : AddSuperWindow(fw_version_rect) ///@note No translations on blue screens. , header(this, header_rect, is_multiline::no, is_closed_on_click_t::no, string_view_utf8::MakeCPUFLASH(reinterpret_cast("UNKNOWN ERROR"))) , title(this, title_rect, is_multiline::no, is_closed_on_click_t::no, string_view_utf8::MakeCPUFLASH(reinterpret_cast("Unable to show details"))) diff --git a/src/gui/screen_blue_error.hpp b/src/gui/screen_blue_error.hpp index 05dc6218e6..07cb7351f0 100644 --- a/src/gui/screen_blue_error.hpp +++ b/src/gui/screen_blue_error.hpp @@ -21,10 +21,8 @@ class ScreenBlueError : public AddSuperWindow { public: ScreenBlueError(); - static const constexpr ResourceId header_font = IDR_FNT_SMALL; - static const constexpr Rect16 header_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(14, 10, 240, GuiDefaults::HeaderHeight - 10) : GuiDefaults::RectHeader; - static const constexpr Rect16 title_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(30, 44, display::GetW() - 60, 20) : Rect16(13, 12, display::GetW() - 26, 20); - static const constexpr Rect16 description_rect = Rect16(13, title_rect.Bottom() + 5, display::GetW() - 26, fw_version_rect.Top() - title_rect.Bottom() - 10); + static const constexpr uint16_t fw_line_top = 265; + static const constexpr Rect16 description_rect = Rect16(13, title_rect.Bottom() + 5, display::GetW() - 26, fw_line_top - title_rect.Bottom() - 10); // Expected size of the description text static const constexpr ResourceId description_font = IDR_FNT_SMALL; diff --git a/src/gui/screen_fatal_warning.cpp b/src/gui/screen_fatal_warning.cpp index e18b4e03a9..4c7721c6e2 100644 --- a/src/gui/screen_fatal_warning.cpp +++ b/src/gui/screen_fatal_warning.cpp @@ -15,32 +15,29 @@ using namespace crash_dump; static const constexpr uint16_t left_padding = ScreenFatalWarning::title_rect.Left(); -static const constexpr uint16_t warining_icon_size = 48; -static const constexpr uint16_t text_start_x = left_padding + warining_icon_size + 10 /* visual delimeter */; static const constexpr uint16_t text_start_y = 85; static const constexpr uint16_t qr_start_x = (display::GetW() * 2) / 3; static const constexpr uint16_t qr_size = 130; -static const constexpr uint16_t info_text_width = 235; +static const constexpr uint16_t info_text_width = 293; -static const constexpr Rect16 warning_rect = Rect16(left_padding, text_start_y, warining_icon_size, warining_icon_size); -static const constexpr Rect16 QR_rect = Rect16(qr_start_x, 44, qr_size, qr_size); +static const constexpr Rect16 QR_rect = Rect16(qr_start_x, 74, qr_size, qr_size); static const constexpr Rect16 hand_rect = Rect16(qr_start_x + /* center under qr */ (qr_size - 59) / 2, qr_size + QR_rect.Top() + 5 /* visual delimeter */, 59, 72); -static const constexpr Rect16 descr_rect = Rect16(text_start_x, text_start_y, info_text_width, 135); -static const constexpr Rect16 help_txt_rect = Rect16(text_start_x, 222, info_text_width, 20); -static const constexpr Rect16 link_rect = Rect16(text_start_x, 244, info_text_width, 20); -static const constexpr Rect16 qr_code_rect = Rect16(180, 265, 100, 20); +static const constexpr Rect16 descr_rect = Rect16(left_padding, text_start_y, info_text_width, 155); +static const constexpr Rect16 help_txt_rect = Rect16(left_padding, 242, info_text_width, 20); +static const constexpr Rect16 link_rect = Rect16(left_padding, 264, info_text_width, 20); +static const constexpr Rect16 qr_code_rect = Rect16(180, 295, 100, 20); +static const constexpr Rect16 fw_version_rect = Rect16(30, 295, display::GetW() - 30, 20); static constexpr const char *const header_label = N_("Wrong hardware"); static constexpr const char *const help_text = N_("More detail at"); static constexpr const char *const unknown_err_txt = N_("Unknown Error"); ScreenFatalWarning::ScreenFatalWarning() - : AddSuperWindow() + : AddSuperWindow(fw_version_rect) , header(this) , err_title(this, title_rect, is_multiline::no) , err_description(this, descr_rect, is_multiline::yes) , hand_icon(this, hand_rect, &img::hand_qr_59x72) - , warning_icon(this, warning_rect, &img::warning_48x48) , qr(this, QR_rect, 1, Align_t::RightTop()) // error code is passed in the constructor , help_txt(this, help_txt_rect, is_multiline::no) , help_link(this, link_rect, is_multiline::no) diff --git a/src/gui/screen_fatal_warning.hpp b/src/gui/screen_fatal_warning.hpp index e740b4d8f4..ed0553fb64 100644 --- a/src/gui/screen_fatal_warning.hpp +++ b/src/gui/screen_fatal_warning.hpp @@ -14,7 +14,6 @@ class ScreenFatalWarning : public AddSuperWindow { window_text_t err_title; window_text_t err_description; window_icon_t hand_icon; - window_icon_t warning_icon; window_qr_t qr; window_text_t help_txt; window_text_t help_link; diff --git a/src/gui/screen_qr_error.cpp b/src/gui/screen_qr_error.cpp index b94c2311f1..afde3d98a2 100644 --- a/src/gui/screen_qr_error.cpp +++ b/src/gui/screen_qr_error.cpp @@ -22,13 +22,14 @@ static const constexpr Rect16 link_rect = GuiDefaults::EnableDialogBigLayout ? R static const constexpr Rect16 qr_code_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(180, 265, 100, 20) : Rect16(100, 295, 64, 13); static const constexpr Rect16 help_txt_rect = Rect16(30, 200, 215, 20); static const constexpr Rect16 title_line_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(30, 70, 420, 1) : Rect16(10, 44, 219, 1); +static const constexpr Rect16 fw_version_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(30, 265, display::GetW() - 30, 20) : Rect16(6, 295, display::GetW() - 6, 13); static constexpr const char *const header_label = N_("ERROR"); static constexpr const char *const help_text = N_("More detail at"); static constexpr const char *const unknown_err_txt = N_("Unknown Error"); ScreenErrorQR::ScreenErrorQR() - : AddSuperWindow() + : AddSuperWindow(fw_version_rect) , header(this) , err_title(this, title_rect, is_multiline::no) , err_description(this, descr_rect, is_multiline::yes) diff --git a/src/gui/screen_reset_error.cpp b/src/gui/screen_reset_error.cpp index 0a455205a2..475ca10479 100644 --- a/src/gui/screen_reset_error.cpp +++ b/src/gui/screen_reset_error.cpp @@ -7,7 +7,7 @@ #include "version.h" #include "support_utils.h" -ScreenResetError::ScreenResetError() +ScreenResetError::ScreenResetError(const Rect16 &fw_version_rect) : AddSuperWindow() , fw_version_txt(this, fw_version_rect, is_multiline::no) , sound_started(false) { diff --git a/src/gui/screen_reset_error.hpp b/src/gui/screen_reset_error.hpp index 741558b10f..e0028c278e 100644 --- a/src/gui/screen_reset_error.hpp +++ b/src/gui/screen_reset_error.hpp @@ -13,10 +13,9 @@ class ScreenResetError : public AddSuperWindow { bool sound_started; public: - ScreenResetError(); + ScreenResetError(const Rect16 &fw_version_rect); static const constexpr Rect16 title_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(30, 44, display::GetW() - 60, 20) : Rect16(10, 24, display::GetW() - 26, 20); - static const constexpr Rect16 fw_version_rect = GuiDefaults::EnableDialogBigLayout ? Rect16(30, 265, display::GetW() - 30, 20) : Rect16(6, 295, display::GetW() - 6, 13); protected: /// starts sound and avoids repetitive starting