XEdDSA packet signing UI (BaseUI) (#10841)

* XEdDSA packet signing UI (BaseUI)

* Move Pixels around for TFT
This commit is contained in:
Jason P
2026-07-02 18:26:54 -05:00
committed by GitHub
co-authored by GitHub
parent 43440dbb9b
commit f273d3f875
5 changed files with 50 additions and 4 deletions
+13 -2
View File
@@ -615,12 +615,22 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
// Shrink Sender name if needed
int availWidth = (mine ? rightTextWidth : leftTextWidth) - display->getStringWidth(timeBuf) -
display->getStringWidth(chanType) - graphics::UIRenderer::measureStringWithEmotes(display, " @...");
display->getStringWidth(chanType) - graphics::UIRenderer::measureStringWithEmotes(display, " *@...");
if (availWidth < 0)
availWidth = 0;
char truncatedSender[64];
graphics::UIRenderer::truncateStringWithEmotes(display, senderName, truncatedSender, sizeof(truncatedSender), availWidth);
// Determine signed-message prefix before building the header line, since it needs to go
// at the front of headerStr rather than appended after (strncat only appends at the end).
const char *signPrefix = "";
#if !(MESHTASTIC_EXCLUDE_PKI_KEYGEN || MESHTASTIC_EXCLUDE_PKI)
bool is_xeddsa_signed = m.xeddsaSigned;
if (is_xeddsa_signed) {
signPrefix = "*";
}
#endif
// Final header line
char headerStr[128];
if (mine) {
@@ -634,7 +644,8 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
snprintf(headerStr, sizeof(headerStr), "%s", timeBuf);
}
} else {
snprintf(headerStr, sizeof(headerStr), chanType[0] ? "%s @%s %s" : "%s @%s", timeBuf, truncatedSender, chanType);
snprintf(headerStr, sizeof(headerStr), chanType[0] ? "%s %s@%s %s" : "%s %s@%s", timeBuf, signPrefix, truncatedSender,
chanType);
}
// Push header line