This commit is contained in:
e2002
2022-11-18 14:01:35 +03:00
parent ef14938dbe
commit 0bb4272d8b
13 changed files with 65 additions and 68 deletions

View File

@@ -61,6 +61,9 @@ void DspCore::initDisplay() {
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
config.theme.plcurrent = TFT_BG;
config.theme.plcurrentbg = TFT_FG;
config.theme.plcurrentfill = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
setContrast(config.store.contrast);

View File

@@ -49,25 +49,7 @@ void DspCore::initDisplay() {
Serial.println(F("SH110X allocation failed"));
for (;;); // Don't proceed, loop forever
}
config.theme.background = TFT_BG;
config.theme.meta = TFT_BG;
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#include "tools/oledcolorfix.h"
cp437(true);
flip();
invert();

View File

@@ -53,24 +53,7 @@ void DspCore::initDisplay() {
Serial.println(F("SSD1305 allocation failed"));
for (;;); // Don't proceed, loop forever
}
config.theme.background = TFT_BG;
config.theme.meta = TFT_BG;
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#include "tools/oledcolorfix.h"
cp437(true);
flip();

View File

@@ -45,24 +45,7 @@ void DspCore::initDisplay() {
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed, loop forever
}
config.theme.background = TFT_BG;
config.theme.meta = TFT_BG;
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#include "tools/oledcolorfix.h"
cp437(true);
flip();
invert();

View File

@@ -0,0 +1,32 @@
#ifndef _OLEDCOLORFIX_H_
#define _OLEDCOLORFIX_H_
config.theme.background = TFT_BG;
#if DSP_INVERT_TITLE
config.theme.meta = TFT_BG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
#else
config.theme.meta = TFT_FG;
config.theme.metabg = TFT_BG;
config.theme.metafill = TFT_BG;
#endif
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
config.theme.plcurrent = TFT_BG;
config.theme.plcurrentbg = TFT_FG;
config.theme.plcurrentfill = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#endif

View File

@@ -376,7 +376,11 @@ void NumWidget::setText(const char* txt) {
strlcpy(_text, txt, _buffsize);
_getBounds();
if (strcmp(_oldtext, _text) == 0) return;
if (_active) dsp.fillRect(_oldleft == 0 ? _realLeft() : min(_oldleft, _realLeft()), _config.top-_textheight+1, max(_oldtextwidth, _textwidth), _textheight, _bgcolor);
uint16_t realth = _textheight;
#ifdef DSP_OLED
realth = _textheight*CHARHEIGHT;
#endif
if (_active) dsp.fillRect(_oldleft == 0 ? _realLeft() : min(_oldleft, _realLeft()), _config.top-_textheight+1, max(_oldtextwidth, _textwidth), realth, _bgcolor);
_oldtextwidth = _textwidth;
_oldleft = _realLeft();
if (_active) _draw();