From d4cd3d0ddfbf8a27fdf47f2b9790fe112d651fce Mon Sep 17 00:00:00 2001 From: philmoz Date: Sat, 10 Dec 2022 16:48:36 +1100 Subject: [PATCH] fix(color): Fix top bar timer widget names sometimes having garbage characters (#2835) Limit length of name text drawn in small size timer widget to prevent random characters appearing --- radio/src/gui/colorlcd/widgets/timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/gui/colorlcd/widgets/timer.cpp b/radio/src/gui/colorlcd/widgets/timer.cpp index dc2e047a4..861f160f7 100644 --- a/radio/src/gui/colorlcd/widgets/timer.cpp +++ b/radio/src/gui/colorlcd/widgets/timer.cpp @@ -112,7 +112,7 @@ class TimerWidget : public Widget } // name if (ZLEN(timerData.name) > 0) { // user name exist - dc->drawText(2, 0, timerData.name, FONT(XS) | COLOR_THEME_PRIMARY2); + dc->drawSizedText(2, 0, timerData.name, LEN_TIMER_NAME, FONT(XS) | COLOR_THEME_PRIMARY2); } else { // user name not exist "TMRn" drawStringWithIndex(dc, 2, 0, "TMR", index + 1, FONT(XS) | COLOR_THEME_PRIMARY2);