From 212963156b82c69267ead7645fbb30d0c39b22c7 Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Fri, 9 May 2025 12:36:21 -0400 Subject: [PATCH] Fixed logic check for minimum pop-up size --- src/graphics/Screen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index d6fe1eada..50cfe9d26 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -347,6 +347,7 @@ static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *sta lines.push_back(alertBannerMessage.substring(start)); // === Measure text dimensions === + uint16_t minWidth = (SCREEN_WIDTH > 128) ? 106 : 78; uint16_t maxWidth = 0; std::vector lineWidths; for (const auto &line : lines) { @@ -357,7 +358,7 @@ static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *sta } uint16_t boxWidth = padding * 2 + maxWidth; - if (needs_bell && boxWidth < (SCREEN_WIDTH > 128) ? 106 : 78) + if (needs_bell && boxWidth < minWidth) boxWidth += (SCREEN_WIDTH > 128) ? 26 : 20; uint16_t boxHeight = padding * 2 + lines.size() * FONT_HEIGHT_SMALL + (lines.size() - 1) * lineSpacing;