From 91575e62410252363710440389c1f7e8619685e3 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Tue, 24 Jan 2023 18:52:09 +0100 Subject: [PATCH 1/3] When a message is received and displayed, include the recevieve-timestamp. So now it functions as a clock and due to the 900s default screen-lock-timeout you still have an idea of when the message was received. --- src/graphics/Screen.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 034ba3307..a16e38600 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -380,10 +380,15 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); display->setColor(BLACK); } - display->drawStringf(0 + x, 0 + y, tempBuf, "From: %s", (node && node->has_user) ? node->user.short_name : "???"); + if(config.display.heading_bold) { - display->drawStringf(1 + x, 0 + y, tempBuf, "From: %s", (node && node->has_user) ? node->user.short_name : "???"); + display->drawStringf(1 + x, 0 + y, tempBuf, " From: %s", (node && node->has_user) ? node->user.short_name : "???"); } + tm *tm = localtime(reinterpret_cast(&mp.rx_time)); + display->drawStringf(0 + x, 0 + y, tempBuf, "[%02d:%02d:%02d] From: %s", + tm->tm_hour, tm->tm_min, tm->tm_sec, + (node && node->has_user) ? node->user.short_name : "???"); + display->setColor(WHITE); snprintf(tempBuf, sizeof(tempBuf), "%s", mp.decoded.payload.bytes); display->drawStringMaxWidth(0 + x, 0 + y + FONT_HEIGHT_SMALL, x + display->getWidth(), tempBuf); From 65c0b8e33b71fedf9f7936edd11ca1c7c81e2c1a Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Wed, 25 Jan 2023 17:41:54 +0100 Subject: [PATCH 2/3] Also print timestamp in bold --- src/graphics/Screen.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 0b07956d0..1c56244bf 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -380,10 +380,13 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state display->setColor(BLACK); } - if(config.display.heading_bold) { - display->drawStringf(1 + x, 0 + y, tempBuf, " From: %s", (node && node->has_user) ? node->user.short_name : "???"); - } tm *tm = localtime(reinterpret_cast(&mp.rx_time)); + + if(config.display.heading_bold) { + display->drawStringf(1 + x, 0 + y, tempBuf, "[%02d:%02d:%02d] From: %s", + tm->tm_hour, tm->tm_min, tm->tm_sec, + (node && node->has_user) ? node->user.short_name : "???"); + } display->drawStringf(0 + x, 0 + y, tempBuf, "[%02d:%02d:%02d] From: %s", tm->tm_hour, tm->tm_min, tm->tm_sec, (node && node->has_user) ? node->user.short_name : "???"); From 0b84c7c0f3d89e8b9a22b07dae20350a721ebbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 29 Jan 2023 19:42:36 +0100 Subject: [PATCH 3/3] trunk fmt --- src/graphics/Screen.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 5ce2a5152..ed5e1c3a0 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -382,14 +382,12 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state tm *tm = localtime(reinterpret_cast(&mp.rx_time)); - if(config.display.heading_bold) { - display->drawStringf(1 + x, 0 + y, tempBuf, "[%02d:%02d:%02d] From: %s", - tm->tm_hour, tm->tm_min, tm->tm_sec, - (node && node->has_user) ? node->user.short_name : "???"); + if (config.display.heading_bold) { + display->drawStringf(1 + x, 0 + y, tempBuf, "[%02d:%02d:%02d] From: %s", tm->tm_hour, tm->tm_min, tm->tm_sec, + (node && node->has_user) ? node->user.short_name : "???"); } - display->drawStringf(0 + x, 0 + y, tempBuf, "[%02d:%02d:%02d] From: %s", - tm->tm_hour, tm->tm_min, tm->tm_sec, - (node && node->has_user) ? node->user.short_name : "???"); + display->drawStringf(0 + x, 0 + y, tempBuf, "[%02d:%02d:%02d] From: %s", tm->tm_hour, tm->tm_min, tm->tm_sec, + (node && node->has_user) ? node->user.short_name : "???"); display->setColor(WHITE); snprintf(tempBuf, sizeof(tempBuf), "%s", mp.decoded.payload.bytes);