Show uppercase category capsule in status bar

This commit is contained in:
Armel FAUVEAU committed 2026-09-24 17:32:47 +02:00
1 parent 05327d0b87
commit 8534c6cd5d
2 files changed
+25

No files matched your search

+3
View File
@@ -909,6 +909,9 @@ void UI_DisplayMenu(void)
uint8_t top_right_badge_line = 1;
#ifdef ENABLE_FEAT_F4HWN_MENU_CAT
// The status bar shows the menu level / category capsule: refresh it.
gUpdateStatus = true;
if (gMenuLevel == MENU_LEVEL_CAT)
{
UI_MENU_DrawCategories();
+22
View File
@@ -35,6 +35,9 @@
#include "settings.h"
#include "ui/battery.h"
#include "ui/helper.h"
#ifdef ENABLE_FEAT_F4HWN_MENU_CAT
#include "ui/menu.h"
#endif
#include "ui/ui.h"
#include "ui/status.h"
@@ -344,6 +347,25 @@ void UI_DisplayStatus()
UI_DrawStatusBattery(line, str);
#ifdef ENABLE_FEAT_F4HWN_MENU_CAT
if (gScreenToDisplay == DISPLAY_MENU) {
// "MENU" at category level, otherwise the uppercased category name.
const char *source = gMenuLevel == MENU_LEVEL_CAT
? "MENU"
: CategoryNames[gMenuCategory];
char text[9]; // longest label ("Channels") + NUL
uint8_t n = 0;
// & 0xDF uppercases letters and keeps the NUL (labels are letters only).
while ((text[n] = (char)(source[n] & 0xDFu)) != '\0')
n++;
// Clear the width of the longest label so shorter ones leave no remnants.
memset(line, 0, 35u);
GUI_DisplaySmallestInverse(text, 2, 0, true, true, (uint8_t)(2u + n * 4u));
}
#endif
// **************
ST7565_BlitStatusLine();