mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
Screen logo, mute icon, and screen wake on new node
This commit is contained in:
parent
efb3f85cd0
commit
9cba2e7b7f
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user