7-segment frequency: inactive segments off, fix MHz colour, +1px RX/TX gap

- Inactive segments now render in the background colour (off) instead of dimmed.
- The 7-seg renderer left the foreground on the last segment drawn (now the
  background colour), which hid MHz; re-apply the frequency theme colour before
  drawing MHz so it reappears and matches the digits.
- Move the TX frequency line down 1px for a little more RX/TX separation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marcus Kida 2026-07-07 15:30:23 +02:00
parent 7f5f3ab06f
commit 734b861917
4 changed files with 10 additions and 6 deletions

View file

@ -7,6 +7,9 @@ single running list until the first versioned release.
## Unreleased
- **7-segment frequency font:** inactive segments are now off (background) instead
of faintly lit — no dim "ghosting". "MHz" now matches the frequency colour, and
there's 1px more space between the RX and TX frequency lines.
- **Screen dimming:** added a **15%** idle-dim level (Off / 100 / 50 / 30 / 15).
- **DM-1701 build support** — the Docker build is now parameterized by platform;
`./build-firmware.sh DM1701` produces `OpenDM1701.bin` (Baofeng DM-1701 /

View file

@ -138,7 +138,7 @@ typedef uint32_t time_t_custom; /* date/time in unix secs past 1-Jan-70 */
#define DISPLAY_Y_POS_SQL_INFO (25 + 8 + DISPLAY_MAIN_CONTENT_TOP_PAD)
#define DISPLAY_Y_POS_TX_TIMER (8 + 16)
#define DISPLAY_Y_POS_RX_FREQ (40 + 40)
#define DISPLAY_Y_POS_TX_FREQ (48 + 48)
#define DISPLAY_Y_POS_TX_FREQ (48 + 48 + 1) // +1px extra gap below the RX frequency line
#define DISPLAY_Y_POS_ZONE (50 + DISPLAY_V_EXTRA_PIXELS)
#define DISPLAY_Y_POS_RSSI_VALUE (18 + 16)
#define DISPLAY_Y_POS_RSSI_BAR (40 + DISPLAY_V_OFFSET)

View file

@ -1106,11 +1106,9 @@ void displayDrawFrequencySevenSeg(int16_t x, int16_t y, int16_t cellW, int16_t c
uint16_t litColour = themeItems[DAYTIME_CURRENT][fgItem];
uint16_t bgColour = themeItems[DAYTIME_CURRENT][THEME_ITEM_BG];
// dimColour: same hue at ~3/8 intensity (round-trip through RGB888) so the
// inactive segments stay clearly visible without washing out the lit ones.
uint32_t rgb = PLATFORM_COLOUR_FORMAT_TO_RGB888(__builtin_bswap16(litColour));
uint32_t dimRgb = (((((rgb >> 16) & 0xFF) * 3) / 8) << 16) | (((((rgb >> 8) & 0xFF) * 3) / 8) << 8) | ((((rgb) & 0xFF) * 3) / 8);
uint16_t dimColour = __builtin_bswap16(RGB888_TO_PLATFORM_COLOUR_FORMAT(dimRgb));
// Inactive segments are drawn in the background colour (i.e. off), so only the
// lit segments show (no dim "ghosting").
uint16_t dimColour = bgColour;
for (const char *p = str; *p != '\0'; p++)
{

View file

@ -2524,6 +2524,9 @@ void uiUtilityDisplayFrequency(uint8_t y, bool isTX, bool hasFocus, uint32_t fre
#else
displayPrintAtDoubleHeight(FREQUENCY_X_POS, yFont3, buffer, FONT_SIZE_3, displayFocusAndDblHeight);
#endif
// Re-apply the frequency colour: the 7-segment renderer leaves the foreground
// set to the last segment drawn, so "MHz" would otherwise use the wrong colour.
displayThemeApply(isTX ? THEME_ITEM_FG_TX_FREQ : THEME_ITEM_FG_RX_FREQ, THEME_ITEM_BG);
displayPrintAtDoubleHeight(DISPLAY_SIZE_X - (3 * 8), yFont3, "MHz", FONT_SIZE_3, displayFocusAndDblHeight);
displayThemeResetToDefault();