mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
refactor(ui): upstream's UIColor palette in place of the DARK/LIGHT enum
- DisplayDriver takes ColorVal; each driver's .cpp defines the UIColor roles (window_bkg, primary_txt, ...) in its own values. ui-new draws in two: window_bkg and primary_txt. OLED and e-ink look as before (sim screens pixel-identical). - E213, E290, LGFX, Null, ST7735, ST7789LCD, U8g2 taken whole from upstream (with them the rewritten ST7735 driver and the Heltec V4 R8 TFT display). - SH1106, SSD1306, ST7789, EinkGfxDisplay and the sim drivers converted. - ui-orig, ui-tiny, simple_* get upstream's colour roles; the repeater's UI taken from upstream (its power-off screen). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -703,9 +703,9 @@ void UITask::renderAlertOverlay() {
|
||||
k = 100 - (100 - k) * (100 - k) / 100;
|
||||
}
|
||||
const int y = -h + h * k / 100;
|
||||
_display->setColor(DisplayDriver::DARK);
|
||||
_display->setColor(UIColor::window_bkg);
|
||||
_display->fillRect(0, y, W, h);
|
||||
_display->setColor(DisplayDriver::LIGHT);
|
||||
_display->setColor(UIColor::primary_txt);
|
||||
_display->drawRect(0, y, W, h);
|
||||
for (int i = 0; i < nl; i++)
|
||||
_display->drawTextCentered(W / 2, y + pad + i * lh, s_wrap_lines[i]);
|
||||
@@ -720,9 +720,9 @@ void UITask::renderMsgBadge() {
|
||||
DisplayDriver& d = *_display;
|
||||
const int s = miniIconScale(d), h = d.headerH() - d.sepH(), w = mailCountWidth(d, _alert_count);
|
||||
const int x = d.width() - w - 2 * s;
|
||||
d.setColor(DisplayDriver::DARK);
|
||||
d.setColor(UIColor::window_bkg);
|
||||
d.fillRect(x - 2 * s, 0, w + 4 * s, h);
|
||||
d.setColor(DisplayDriver::LIGHT);
|
||||
d.setColor(UIColor::primary_txt);
|
||||
if (msgBadgeLit()) drawMailCount(d, x, 0, h, _alert_count);
|
||||
}
|
||||
|
||||
@@ -1488,7 +1488,7 @@ void UITask::loop() {
|
||||
if (_display != NULL) {
|
||||
_display->startFrame();
|
||||
_display->setTextSize(1);
|
||||
_display->setColor(DisplayDriver::LIGHT);
|
||||
_display->setColor(UIColor::primary_txt);
|
||||
int mid = _display->height() / 2;
|
||||
int step = _display->lineStep();
|
||||
_display->drawTextCentered(_display->width() / 2, mid - step, "Low Battery");
|
||||
|
||||
Reference in New Issue
Block a user