mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-05 13:14:45 +00:00
Update positioning on Message frame and fix drawCommonHeader overlay
This commit is contained in:
parent
53d28f3a3a
commit
791377b76b
@ -60,11 +60,14 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti
|
|||||||
|
|
||||||
// === Inverted Header Background ===
|
// === Inverted Header Background ===
|
||||||
if (isInverted) {
|
if (isInverted) {
|
||||||
|
display->setColor(BLACK);
|
||||||
|
display->fillRect(0, 0, screenW, highlightHeight + 2);
|
||||||
|
display->setColor(WHITE);
|
||||||
drawRoundedHighlight(display, x, y, screenW, highlightHeight, 2);
|
drawRoundedHighlight(display, x, y, screenW, highlightHeight, 2);
|
||||||
display->setColor(BLACK);
|
display->setColor(BLACK);
|
||||||
} else {
|
} else {
|
||||||
display->setColor(BLACK);
|
display->setColor(BLACK);
|
||||||
display->fillRect(0, 0, screenW, highlightHeight + 3);
|
display->fillRect(0, 0, screenW, highlightHeight + 2);
|
||||||
display->setColor(WHITE);
|
display->setColor(WHITE);
|
||||||
if (screenW > 128) {
|
if (screenW > 128) {
|
||||||
display->drawLine(0, 20, screenW, 20);
|
display->drawLine(0, 20, screenW, 20);
|
||||||
|
@ -246,7 +246,7 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
display->drawString(x + 4, headerY, headerStr);
|
display->drawString(x + 4, headerY, headerStr);
|
||||||
|
|
||||||
// Draw separator (same as scroll version)
|
// Draw separator (same as scroll version)
|
||||||
for (int separatorX = 0; separatorX <= (display->getStringWidth(headerStr) + 3); separatorX += 2) {
|
for (int separatorX = 1; separatorX <= (display->getStringWidth(headerStr) + 2); separatorX += 2) {
|
||||||
display->setPixel(separatorX, headerY + ((SCREEN_WIDTH > 128) ? 19 : 13));
|
display->setPixel(separatorX, headerY + ((SCREEN_WIDTH > 128) ? 19 : 13));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
|
|
||||||
int scrollOffset = static_cast<int>(scrollY);
|
int scrollOffset = static_cast<int>(scrollY);
|
||||||
int yOffset = -scrollOffset + getTextPositions(display)[1];
|
int yOffset = -scrollOffset + getTextPositions(display)[1];
|
||||||
for (int separatorX = 0; separatorX <= (display->getStringWidth(headerStr) + 3); separatorX += 2) {
|
for (int separatorX = 1; separatorX <= (display->getStringWidth(headerStr) + 2); separatorX += 2) {
|
||||||
display->setPixel(separatorX, yOffset + ((SCREEN_WIDTH > 128) ? 19 : 13));
|
display->setPixel(separatorX, yOffset + ((SCREEN_WIDTH > 128) ? 19 : 13));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,9 +374,9 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
lineY += rowHeights[j];
|
lineY += rowHeights[j];
|
||||||
if (lineY > -rowHeights[i] && lineY < scrollBottom) {
|
if (lineY > -rowHeights[i] && lineY < scrollBottom) {
|
||||||
if (i == 0 && isInverted) {
|
if (i == 0 && isInverted) {
|
||||||
display->drawString(x + 3, lineY, lines[i].c_str());
|
display->drawString(x, lineY, lines[i].c_str());
|
||||||
if (isBold)
|
if (isBold)
|
||||||
display->drawString(x + 4, lineY, lines[i].c_str());
|
display->drawString(x, lineY, lines[i].c_str());
|
||||||
} else {
|
} else {
|
||||||
drawStringWithEmotes(display, x, lineY, lines[i], emotes, numEmotes);
|
drawStringWithEmotes(display, x, lineY, lines[i], emotes, numEmotes);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user