Browse Source

* T114 display fix

ui-color-refactor
Scott Powell 6 days ago
parent
commit
f83ad03e5e
  1. 6
      examples/companion_radio/ui-new/UITask.cpp
  2. 18
      src/helpers/ui/ST7789Display.cpp

6
examples/companion_radio/ui-new/UITask.cpp

@ -204,7 +204,11 @@ public:
renderBatteryIndicator(display, _task->getBattMilliVolts()); renderBatteryIndicator(display, _task->getBattMilliVolts());
// curr page indicator // curr page indicator
display.setColor(UIColor::title_bkg); if (UIColor::title_bkg == UIColor::window_bkg) {
display.setColor(UIColor::title_txt);
} else {
display.setColor(UIColor::title_bkg);
}
int y = 14; int y = 14;
int x = display.width() / 2 - 5 * (HomePage::Count-1); int x = display.width() / 2 - 5 * (HomePage::Count-1);
for (uint8_t i = 0; i < HomePage::Count; i++, x += 10) { for (uint8_t i = 0; i < HomePage::Count; i++, x += 10) {

18
src/helpers/ui/ST7789Display.cpp

@ -27,15 +27,15 @@
#endif #endif
// Color scheme // Color scheme
ColorVal UIColor::window_bkg = OLEDDISPLAY_COLOR::WHITE; ColorVal UIColor::window_bkg = OLEDDISPLAY_COLOR::BLACK;
ColorVal UIColor::title_bkg = OLEDDISPLAY_COLOR::WHITE; ColorVal UIColor::title_bkg = OLEDDISPLAY_COLOR::BLACK;
ColorVal UIColor::title_txt = OLEDDISPLAY_COLOR::BLACK; ColorVal UIColor::title_txt = OLEDDISPLAY_COLOR::WHITE;
ColorVal UIColor::primary_txt = OLEDDISPLAY_COLOR::BLACK; ColorVal UIColor::primary_txt = OLEDDISPLAY_COLOR::WHITE;
ColorVal UIColor::secondary_txt = OLEDDISPLAY_COLOR::BLACK; ColorVal UIColor::secondary_txt = OLEDDISPLAY_COLOR::WHITE;
ColorVal UIColor::warning_txt = OLEDDISPLAY_COLOR::BLACK; ColorVal UIColor::warning_txt = OLEDDISPLAY_COLOR::WHITE;
ColorVal UIColor::popup_bkg = OLEDDISPLAY_COLOR::WHITE; ColorVal UIColor::popup_bkg = OLEDDISPLAY_COLOR::BLACK;
ColorVal UIColor::popup_txt = OLEDDISPLAY_COLOR::BLACK; ColorVal UIColor::popup_txt = OLEDDISPLAY_COLOR::WHITE;
ColorVal UIColor::corp_blue = OLEDDISPLAY_COLOR::BLACK; ColorVal UIColor::corp_blue = OLEDDISPLAY_COLOR::WHITE;
bool ST7789Display::begin() { bool ST7789Display::begin() {
if(!_isOn) { if(!_isOn) {

Loading…
Cancel
Save