Fix issues with skin and theme selector

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-03-26 17:55:59 +01:00
parent 654869c90d
commit 376668f72b
3 changed files with 123 additions and 51 deletions
+1 -1
View File
@@ -558,7 +558,7 @@ void setup() {
FrequencySprite.createSprite(200, 50);
FrequencySprite.setTextDatum(TR_DATUM);
RDSSprite.createSprite(172, 19);
RDSSprite.createSprite(165, 19);
RDSSprite.setTextDatum(TL_DATUM);
SquelchSprite.createSprite(47, 19);
+57 -3
View File
@@ -417,6 +417,38 @@ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de
BatteryValueColor = Teal;
BatteryValueColorSmooth = Black;
break;
case 13: // New skin theme
PrimaryColor = Yellow;
PrimaryColorSmooth = YellowSmooth;
SecondaryColor = Skyblue;
SecondaryColorSmooth = SkyblueSmooth;
FrameColor = Blue;
GreyoutColor = Darkgrey;
BackgroundColor = Black;
ActiveColor = White;
ActiveColorSmooth = WhiteSmooth;
FreqColor = Yellow;
FreqColorSmooth = YellowSmooth;
SignificantColor = Red;
SignificantColorSmooth = RedSmooth;
InsignificantColor = Green;
InsignificantColorSmooth = GreenSmooth;
StereoColor = Red;
StereoColorSmooth = RedSmooth;
RDSColor = Yellow;
RDSColorSmooth = YellowSmooth;
RDSDropoutColor = Teal;
RDSDropoutColorSmooth = TealSmooth;
BarSignificantColor = Red;
BarInsignificantColor = Green;
ModBarSignificantColor = Red;
ModBarInsignificantColor = Green;
BWAutoColor = Teal;
BWAutoColorSmooth = TealSmooth;
BatteryValueColor = Teal;
BatteryValueColorSmooth = Black;
break;
}
}
@@ -1215,7 +1247,7 @@ void ShowOneLine(byte position, byte item, bool selected) {
FullLineSprite.setTextDatum(TR_DATUM);
FullLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
FullLineSprite.drawString(Theme[CurrentTheme], 298, 3);
if (CurrentSkin != 1) FullLineSprite.drawString(Theme[CurrentTheme], 298, 3);
break;
case RDSSETTINGS:
@@ -1929,12 +1961,17 @@ void MenuUp() {
CurrentSkin ++;
if (CurrentSkin > sizeof(Skin) / sizeof(Skin[0]) - 1) CurrentSkin = 0;
BuildMenu();
if (CurrentSkin == 0) {
CurrentTheme = 0;
doTheme();
BuildMenu();
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
OneBigLineSprite.fillSprite(BackgroundColor);
} else if (CurrentSkin == 1) {
CurrentTheme = 13;
doTheme();
BuildMenu();
tft.pushImage (13, 30, 292, 170, popupbackground);
OneBigLineSprite.pushImage(-11, -88, 292, 170, popupbackground);
OneBigLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
@@ -1947,10 +1984,12 @@ void MenuUp() {
break;
case ITEM9:
if (CurrentSkin != 1) {
CurrentTheme ++;
if (CurrentTheme > sizeof(Theme) / sizeof(Theme[0]) - 1) CurrentTheme = 0;
doTheme();
if (CurrentSkin == 0) {
OneBigLineSprite.fillSprite(BackgroundColor);
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
} else if (CurrentSkin == 1) {
@@ -1960,8 +1999,10 @@ void MenuUp() {
OneBigLineSprite.setTextDatum(TC_DATUM);
}
Infoboxprint(myLanguage[language][77]);
OneBigLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
OneBigLineSprite.drawString(Theme[CurrentTheme], 135, 0);
OneBigLineSprite.pushSprite(24, 118);
}
break;
case ITEM10:
@@ -2690,12 +2731,17 @@ void MenuDown() {
CurrentSkin --;
if (CurrentSkin > sizeof(Skin) / sizeof(Skin[0]) - 1) CurrentSkin = sizeof(Skin) / sizeof(Skin[0]) - 1;
BuildMenu();
if (CurrentSkin == 0) {
CurrentTheme = 0;
doTheme();
BuildMenu();
OneBigLineSprite.fillSprite(BackgroundColor);
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
} else if (CurrentSkin == 1) {
CurrentTheme = 13;
doTheme();
BuildMenu();
tft.pushImage (13, 30, 292, 170, popupbackground);
OneBigLineSprite.pushImage(-11, -88, 292, 170, popupbackground);
OneBigLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
@@ -2708,11 +2754,13 @@ void MenuDown() {
break;
case ITEM9:
if (CurrentSkin != 1) {
CurrentTheme --;
if (CurrentTheme > sizeof(Theme) / sizeof(Theme[0]) - 1) CurrentTheme = sizeof(Theme) / sizeof(Theme[0]) - 1;
doTheme();
if (CurrentSkin == 0) {
OneBigLineSprite.fillSprite(BackgroundColor);
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
} else if (CurrentSkin == 1) {
@@ -2722,8 +2770,10 @@ void MenuDown() {
OneBigLineSprite.setTextDatum(TC_DATUM);
}
Infoboxprint(myLanguage[language][77]);
OneBigLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
OneBigLineSprite.drawString(Theme[CurrentTheme], 135, 0);
OneBigLineSprite.pushSprite(24, 118);
}
break;
case ITEM10:
@@ -3489,9 +3539,13 @@ void DoMenu() {
break;
case ITEM9:
if (CurrentSkin != 1) {
Infoboxprint(myLanguage[language][77]);
OneBigLineSprite.drawString(Theme[CurrentTheme], 135, 0);
} else {
Infoboxprint(myLanguage[language][208]);
}
OneBigLineSprite.pushSprite(24, 118);
break;
+37 -19
View File
@@ -5,7 +5,7 @@
// [number of languages][number of texts]
// *** means the text is the same as in English
static const char* const myLanguage[18][208] PROGMEM = {
static const char* const myLanguage[18][209] PROGMEM = {
{ "English", // English
"Rotary direction changed", // 1
"Please release button", // 2
@@ -213,7 +213,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Nederlands", // Dutch
@@ -423,7 +424,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Standaard", // 204
"Scherm uit bij\nXDRGTK verbinding", // 205
"FMSI stereo verbetering", // 206
"Alleen beschikbaar op\nTEF6687/6689!" // 207
"Alleen beschikbaar op\nTEF6687/6689!", // 207
"Niet beschikbaar op\ngekozen uiterlijk!" // 208
},
{ "Polski", // Polish
@@ -633,7 +635,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Domyslny", // 204
"Wylacz ekran gdy\npołączony z XDR-GTK", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Hrvatski", // Croatian
@@ -843,7 +846,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Zadano", // 204
"Isključi zaslon\ntijekom veze XDRGTK-om", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Ελληνικά", // Greek
@@ -1053,7 +1057,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Προεπιλογή", // 204
"Μαύρη οθόνη σε\nσύνδεση XDRGTK", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Română", // Romanian
@@ -1263,7 +1268,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Mod implicit", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Deutsch", // German
@@ -1473,7 +1479,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Český", // Czech
@@ -1683,7 +1690,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Slovenský", // Slovak
@@ -1893,7 +1901,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Français", // French
@@ -2103,7 +2112,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Défaut", // 204
"Écran muet sur\nla connexion XDRGTK", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Български", // Bulgarian
@@ -2313,7 +2323,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Русский", // Russian
@@ -2523,7 +2534,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Українська", // Ukranian
@@ -2733,7 +2745,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Italiano", // Italian
@@ -2943,7 +2956,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Default", // 204
"Mute screen on\nXDRGTK connection", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Simplified Chinese", // Simplified Chinese
@@ -3153,7 +3167,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"默认", // 204
"XDRGTK连接时锁屏", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Norsk", // Norwegian
@@ -3363,7 +3378,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Standard", // 204
"Dempet skjerm på\nXDRGTK tilkobling", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Español", // Spanish
@@ -3573,7 +3589,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Por defecto", // 204
"Pantalla de mudo\nen la conexión XDRGTK", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
},
{ "Português", // Portuguese
@@ -3783,7 +3800,8 @@ static const char* const myLanguage[18][208] PROGMEM = {
"Predefinição", // 204
"Tela mudo na\nconexão XDRGTK", // 205
"FMSI stereo improvement", // 206
"Function only available\non TEF6687/6689!" // 207
"Function only available\non TEF6687/6689!", // 207
"Function not available\non selected skin!" // 208
}
};
#endif