This commit is contained in:
e2002
2022-10-18 10:08:42 +03:00
parent aac04b6a9e
commit bfb6cd822a
7 changed files with 55 additions and 33 deletions

View File

@@ -49,34 +49,37 @@ uint16_t Config::color565(uint8_t r, uint8_t g, uint8_t b)
}
void Config::loadTheme(){
theme.background = color565(COLOR_BACKGROUND);
theme.meta = color565(COLOR_STATION_NAME);
theme.metabg = color565(COLOR_STATION_BG);
theme.metafill = color565(COLOR_STATION_FILL);
theme.title1 = color565(COLOR_SNG_TITLE_1);
theme.title2 = color565(COLOR_SNG_TITLE_2);
theme.digit = color565(COLOR_DIGITS);
theme.div = color565(COLOR_DIVIDER);
theme.weather = color565(COLOR_WEATHER);
theme.vumax = color565(COLOR_VU_MAX);
theme.vumin = color565(COLOR_VU_MIN);
theme.clock = color565(COLOR_CLOCK);
theme.seconds = color565(COLOR_SECONDS);
theme.dow = color565(COLOR_DAY_OF_W);
theme.date = color565(COLOR_DATE);
theme.heap = color565(COLOR_HEAP);
theme.buffer = color565(COLOR_BUFFER);
theme.ip = color565(COLOR_IP);
theme.vol = color565(COLOR_VOLUME_VALUE);
theme.rssi = color565(COLOR_RSSI);
theme.bitrate = color565(COLOR_BITRATE);
theme.volbarout = color565(COLOR_VOLBAR_OUT);
theme.volbarin = color565(COLOR_VOLBAR_IN);
theme.playlist[0] = color565(COLOR_PLAYLIST_0);
theme.playlist[1] = color565(COLOR_PLAYLIST_1);
theme.playlist[2] = color565(COLOR_PLAYLIST_2);
theme.playlist[3] = color565(COLOR_PLAYLIST_3);
theme.playlist[4] = color565(COLOR_PLAYLIST_4);
theme.background = color565(COLOR_BACKGROUND);
theme.meta = color565(COLOR_STATION_NAME);
theme.metabg = color565(COLOR_STATION_BG);
theme.metafill = color565(COLOR_STATION_FILL);
theme.title1 = color565(COLOR_SNG_TITLE_1);
theme.title2 = color565(COLOR_SNG_TITLE_2);
theme.digit = color565(COLOR_DIGITS);
theme.div = color565(COLOR_DIVIDER);
theme.weather = color565(COLOR_WEATHER);
theme.vumax = color565(COLOR_VU_MAX);
theme.vumin = color565(COLOR_VU_MIN);
theme.clock = color565(COLOR_CLOCK);
theme.seconds = color565(COLOR_SECONDS);
theme.dow = color565(COLOR_DAY_OF_W);
theme.date = color565(COLOR_DATE);
theme.heap = color565(COLOR_HEAP);
theme.buffer = color565(COLOR_BUFFER);
theme.ip = color565(COLOR_IP);
theme.vol = color565(COLOR_VOLUME_VALUE);
theme.rssi = color565(COLOR_RSSI);
theme.bitrate = color565(COLOR_BITRATE);
theme.volbarout = color565(COLOR_VOLBAR_OUT);
theme.volbarin = color565(COLOR_VOLBAR_IN);
theme.plcurrent = color565(COLOR_PL_CURRENT);
theme.plcurrentbg = color565(COLOR_PL_CURRENT_BG);
theme.plcurrentfill = color565(COLOR_PL_CURRENT_FILL);
theme.playlist[0] = color565(COLOR_PLAYLIST_0);
theme.playlist[1] = color565(COLOR_PLAYLIST_1);
theme.playlist[2] = color565(COLOR_PLAYLIST_2);
theme.playlist[3] = color565(COLOR_PLAYLIST_3);
theme.playlist[4] = color565(COLOR_PLAYLIST_4);
}
template <class T> int Config::eepromWrite(int ee, const T& value) {

View File

@@ -48,6 +48,9 @@ struct theme_t {
uint16_t bitrate;
uint16_t volbarout;
uint16_t volbarin;
uint16_t plcurrent;
uint16_t plcurrentbg;
uint16_t plcurrentfill;
uint16_t playlist[5];
};
struct config_t

View File

@@ -78,13 +78,13 @@ void Display::_buildPager(){
#if DSP_MODEL==DSP_NOKIA5110
_plcurrent.init("*", playlistConf, 0, 1);
#else
_plcurrent.init("*", playlistConf, config.theme.meta, config.theme.metabg);
_plcurrent.init("*", playlistConf, config.theme.plcurrent, config.theme.plcurrentbg);
#endif
#ifndef HIDE_TITLE2
_title2 = new ScrollWidget("*", title2Conf, config.theme.title2, config.theme.background);
#endif
#if !defined(DSP_LCD) && DSP_MODEL!=DSP_NOKIA5110
_plbackground = new FillWidget(playlBGConf, config.theme.metafill);
_plbackground = new FillWidget(playlBGConf, config.theme.plcurrentfill);
_metabackground = new FillWidget(metaBGConf, config.theme.metafill);
#endif
#if DSP_MODEL==DSP_NOKIA5110

View File

@@ -1,7 +1,7 @@
#ifndef options_h
#define options_h
#define VERSION "0.8.01b"
#define VERSION "0.8.02b"
/*******************************************************
DO NOT EDIT THIS FILE.
@@ -307,6 +307,15 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#ifndef COLOR_DIVIDER
#define COLOR_DIVIDER 165, 162, 132
#endif
#ifndef COLOR_PL_CURRENT
#define COLOR_PL_CURRENT 0, 0, 0
#endif
#ifndef COLOR_PL_CURRENT_BG
#define COLOR_PL_CURRENT_BG 231, 211, 90
#endif
#ifndef COLOR_PL_CURRENT_FILL
#define COLOR_PL_CURRENT_FILL 231, 211, 90
#endif
#ifndef COLOR_PLAYLIST_0
#define COLOR_PLAYLIST_0 115, 115, 115
#endif

View File

@@ -258,7 +258,7 @@ void SliderWidget::_draw() {
}
void SliderWidget::_clear() {
_oldvalwidth = 0;
// _oldvalwidth = 0;
dsp.fillRect(_config.left, _config.top, _width, _height, _bgcolor);
}
/************************