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:
@@ -11,6 +11,17 @@ bool SH1106Display::i2c_probe(TwoWire &wire, uint8_t addr)
|
||||
return (error == 0);
|
||||
}
|
||||
|
||||
// Color scheme
|
||||
ColorVal UIColor::window_bkg = SH110X_BLACK;
|
||||
ColorVal UIColor::title_bkg = SH110X_BLACK;
|
||||
ColorVal UIColor::title_txt = SH110X_WHITE;
|
||||
ColorVal UIColor::primary_txt = SH110X_WHITE;
|
||||
ColorVal UIColor::secondary_txt = SH110X_WHITE;
|
||||
ColorVal UIColor::warning_txt = SH110X_WHITE;
|
||||
ColorVal UIColor::popup_bkg = SH110X_BLACK;
|
||||
ColorVal UIColor::popup_txt = SH110X_WHITE;
|
||||
ColorVal UIColor::corp_blue = SH110X_WHITE;
|
||||
|
||||
bool SH1106Display::begin()
|
||||
{
|
||||
// Wire must already be initialised by board.begin() before this is called.
|
||||
@@ -55,7 +66,7 @@ void SH1106Display::clear()
|
||||
_force_redraw = true; // next endFrame() must flush even if its CRC matches a pre-clear frame
|
||||
}
|
||||
|
||||
void SH1106Display::startFrame(Color bkg)
|
||||
void SH1106Display::startFrame(ColorVal bkg)
|
||||
{
|
||||
display.clearDisplay(); // TODO: apply 'bkg'
|
||||
_color = SH110X_WHITE;
|
||||
@@ -102,9 +113,9 @@ void SH1106Display::setTextSize(int sz)
|
||||
display.setTextSize(sz);
|
||||
}
|
||||
|
||||
void SH1106Display::setColor(Color c)
|
||||
void SH1106Display::setColor(ColorVal c)
|
||||
{
|
||||
_color = (c != 0) ? SH110X_WHITE : SH110X_BLACK;
|
||||
_color = c;
|
||||
display.setTextColor(_color);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user