From 9cba2e7b7f35662d584464b384efbebdf4e2b848 Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Tue, 13 May 2025 10:00:34 -0400 Subject: [PATCH] Screen logo, mute icon, and screen wake on new node --- src/graphics/Screen.cpp | 20 ++++++++++---------- src/graphics/SharedUIDisplay.cpp | 26 ++++++++++++++++++++------ src/graphics/images.h | 8 ++++++++ src/modules/NodeInfoModule.cpp | 7 ------- 4 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 622191e17..d935881ae 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -3,8 +3,8 @@ BaseUI Developed and Maintained By: - Ronald Garcia (HarukiToreda) – Lead development and implementation. -- JasonP (aka Xaositek) – Screen layout and icon design, UI improvements and testing. -- TonyG (aka Tropho) – Project management, structural planning, and testing +- JasonP (Xaositek) – Screen layout and icon design, UI improvements and testing. +- TonyG (Tropho) – Project management, structural planning, and testing This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -178,22 +178,22 @@ static void drawIconScreen(const char *upperMsg, OLEDDisplay *display, OLEDDispl if (SCREEN_WIDTH > 128) { // === ORIGINAL WIDE SCREEN LAYOUT (unchanged) === int padding = 4; - int boxWidth = max(icon_width, textWidth) + padding * 2; - int boxHeight = icon_height + FONT_HEIGHT_SMALL + padding * 3; + int boxWidth = max(icon_width, textWidth) + (padding * 2) + 16; + int boxHeight = icon_height + FONT_HEIGHT_SMALL + (padding * 3) - 8; int boxX = x - 1 + (SCREEN_WIDTH - boxWidth) / 2; - int boxY = y + (SCREEN_HEIGHT - boxHeight) / 2; + int boxY = y - 6 + (SCREEN_HEIGHT - boxHeight) / 2; display->setColor(WHITE); display->fillRect(boxX + r, boxY, boxWidth - 2 * r, boxHeight); display->fillRect(boxX, boxY + r, boxWidth - 1, boxHeight - 2 * r); - display->fillCircle(boxX + r, boxY + r, r); - display->fillCircle(boxX + boxWidth - r - 1, boxY + r, r); - display->fillCircle(boxX + r, boxY + boxHeight - r - 1, r); - display->fillCircle(boxX + boxWidth - r - 1, boxY + boxHeight - r - 1, r); + display->fillCircle(boxX + r, boxY + r, r); // Upper Left + display->fillCircle(boxX + boxWidth - r - 1, boxY + r, r); // Upper Right + display->fillCircle(boxX + r, boxY + boxHeight - r - 1, r); // Lower Left + display->fillCircle(boxX + boxWidth - r - 1, boxY + boxHeight - r - 1, r); // Lower Right display->setColor(BLACK); int iconX = boxX + (boxWidth - icon_width) / 2; - int iconY = boxY + padding; + int iconY = boxY + padding - 2; display->drawXbm(iconX, iconY, icon_width, icon_height, icon_bits); int labelY = iconY + icon_height + padding; diff --git a/src/graphics/SharedUIDisplay.cpp b/src/graphics/SharedUIDisplay.cpp index bd768f4d8..39c2f3fec 100644 --- a/src/graphics/SharedUIDisplay.cpp +++ b/src/graphics/SharedUIDisplay.cpp @@ -56,6 +56,8 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y) const int screenW = display->getWidth(); const int screenH = display->getHeight(); + const bool useBigIcons = (screenW > 128); + // === Inverted Header Background === if (isInverted) { drawRoundedHighlight(display, x, y, screenW, highlightHeight, 2); @@ -176,9 +178,15 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y) display->drawXbm(iconX, iconY, mail_width, mail_height, mail); } } else if (isMuted) { - int iconX = iconRightEdge - mute_symbol_width; - int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; - display->drawXbm(iconX, iconY, mute_symbol_width, mute_symbol_height, mute_symbol); + if (useBigIcons) { + int iconX = iconRightEdge - mute_symbol_big_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mute_symbol_big_height) / 2; + display->drawXbm(iconX, iconY, mute_symbol_big_width, mute_symbol_big_height, mute_symbol_big); + } else { + int iconX = iconRightEdge - mute_symbol_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; + display->drawXbm(iconX, iconY, mute_symbol_width, mute_symbol_height, mute_symbol); + } } // === Draw Time === @@ -216,9 +224,15 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y) display->drawXbm(iconX, iconY, mail_width, mail_height, mail); } } else if (isMuted) { - int iconX = iconRightEdge - mute_symbol_width; - int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; - display->drawXbm(iconX, iconY, mute_symbol_width, bell_alert_height, mute_symbol); + if (useBigIcons) { + int iconX = iconRightEdge - mute_symbol_big_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mute_symbol_big_height) / 2; + display->drawXbm(iconX, iconY, mute_symbol_big_width, mute_symbol_big_height, mute_symbol_big); + } else { + int iconX = iconRightEdge - mute_symbol_width; + int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2; + display->drawXbm(iconX, iconY, mute_symbol_width, mute_symbol_height, mute_symbol); + } } } diff --git a/src/graphics/images.h b/src/graphics/images.h index b4847b5dc..cdd0c3502 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -419,6 +419,14 @@ const uint8_t mute_symbol[] PROGMEM = { 0b10011000, // █ }; +#define mute_symbol_big_width 16 +#define mute_symbol_big_height 16 +const uint8_t mute_symbol_big[] PROGMEM = {0b00000001, 0b00000000, 0b11000010, 0b00000011, 0b00110100, 0b00001100, 0b00011000, + 0b00001000, 0b00011000, 0b00010000, 0b00101000, 0b00010000, 0b01001000, 0b00010000, + 0b10001000, 0b00010000, 0b00001000, 0b00010001, 0b00001000, 0b00010010, 0b00001000, + 0b00010100, 0b00000100, 0b00101000, 0b11111100, 0b00111111, 0b01000000, 0b00100010, + 0b10000000, 0b01000001, 0b00000000, 0b10000000}; + // Bell icon for Alert Message #define bell_alert_width 8 #define bell_alert_height 8 diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index ce4a6bd06..b80624887 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -18,13 +18,6 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes bool wasBroadcast = isBroadcast(mp.to); - // Show new nodes on LCD screen - if (wasBroadcast) { - String lcd = String("Joined: ") + p.long_name + "\n"; - if (screen) - screen->print(lcd.c_str()); - } - // if user has changed while packet was not for us, inform phone if (hasChanged && !wasBroadcast && !isToUs(&mp)) service->sendToPhone(packetPool.allocCopy(mp));