This commit is contained in:
Ben Meadors 2025-05-31 13:51:30 -05:00
parent 3770e43d86
commit 298e5d36c9
3 changed files with 9 additions and 10 deletions

View File

@ -139,13 +139,6 @@ static bool heartbeat = false;
extern bool hasUnreadMessage;
void Screen::drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *message)
{
uint16_t x_offset = display->width() / 2;
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->setFont(FONT_MEDIUM);
display->drawString(x_offset + x, 26 + y, message);
}
// ==============================
// Overlay Alert Banner Renderer
// ==============================
@ -1002,7 +995,7 @@ void Screen::setup()
alertFrames[0] = [this](OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) {
#ifdef ARCH_ESP32
if (wakeCause == ESP_SLEEP_WAKEUP_TIMER || wakeCause == ESP_SLEEP_WAKEUP_EXT1)
drawFrameText(display, state, x, y, "Resuming...");
graphics::UIRenderer::drawFrameText(display, state, x, y, "Resuming...");
else
#endif
{

View File

@ -233,8 +233,6 @@ class Screen : public concurrency::OSThread
void blink();
void drawFrameText(OLEDDisplay *, OLEDDisplayUiState *, int16_t, int16_t, const char *);
void getTimeAgoStr(uint32_t agoSecs, char *timeStr, uint8_t maxLength);
// Draw north

View File

@ -1223,6 +1223,14 @@ void drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *state)
display->setColor(WHITE);
}
void drawFrameText(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y, const char *message)
{
uint16_t x_offset = display->width() / 2;
display->setTextAlignment(TEXT_ALIGN_CENTER);
display->setFont(FONT_MEDIUM);
display->drawString(x_offset + x, 26 + y, message);
}
std::string drawTimeDelta(uint32_t days, uint32_t hours, uint32_t minutes, uint32_t seconds)
{
std::string uptime;