Fix test widget

This commit is contained in:
3djc
2021-04-19 11:47:50 +02:00
parent 9b3877681f
commit 01cc3aa99f
5 changed files with 24 additions and 5 deletions
+10 -2
View File
@@ -83,14 +83,22 @@ WidgetSettings::WidgetSettings(Window * parent, Widget * widget) :
break;
case ZoneOption::String:
new ModelTextEdit(form, grid.getFieldSlot(), widget->getOptionValue(optIdx)->stringValue, sizeof( widget->getOptionValue(optIdx)->stringValue));
break;
case ZoneOption::File:
break;
case ZoneOption::TextSize:
case ZoneOption::TextSize: {
new Choice(form, grid.getFieldSlot(), STR_FONT_SIZES, 0, FONTS_COUNT - 1,
[=]() -> int { // getValue
return (int) widget->getOptionValue(optIdx)->unsignedValue;
},
[=](int newValue) { // setValue
widget->getOptionValue(optIdx)->unsignedValue = (uint32_t) newValue;
});
break;
}
case ZoneOption::Timer: // Unsigned
{
auto tmChoice = new Choice(form, grid.getFieldSlot(), 0, TIMERS - 1,
-3
View File
@@ -33,9 +33,6 @@ class TextWidget: public Widget
void paint(BitmapBuffer * dc) override
{
// clear the background
dc->clear(DEFAULT_BGCOLOR);
// get font color from options[1]
lcdSetColor(persistentData->options[1].value.unsignedValue);
+3
View File
@@ -22,6 +22,9 @@
#define ISTR(x) const char STR_##x[] = LEN_##x TR_##x
#if defined(COLORLCD)
ISTR(FONT_SIZES);
#endif
ISTR(OFFON);
ISTR(MMMINV);
ISTR(VBEEPMODE);
+1
View File
@@ -152,6 +152,7 @@ extern const char STR_USBMODES[];
extern const char STR_JACK_MODES[];
extern const char STR_VFAILSAFE[];
extern const char STR_FONT_SIZES[];
extern const char STR_VTRAINERMODES[];
extern const char STR_EXTERNAL_MODULE_PROTOCOLS[];
extern const char STR_INTERNAL_MODULE_PROTOCOLS[];
+10
View File
@@ -100,6 +100,16 @@
#define TR_MODULE_R9M_LITE "R9MLite\0 "
#endif
#if defined(COLORLCD)
#if defined(BOLD)
#define LEN_FONT_SIZES "\003"
#define TR_FONT_SIZES "STD"
#else
#define LEN_FONT_SIZES "\004"
#define TR_FONT_SIZES "STD\0""BOLD""XXS\0""XS\0 ""L\0 ""XL\0 ""XXL\0"
#endif
#endif
#define LEN_EXTERNAL_MODULE_PROTOCOLS "\014"
#define TR_EXTERNAL_MODULE_PROTOCOLS "OFF\0 ""PPM\0 ""XJT\0 ""ISRM\0 ""DSM2\0 ""CRSF\0 ""MULTI\0 ""R9M\0 ""R9M ACCESS\0 " TR_MODULE_R9M_LITE "R9ML ACCESS\0""GHST\0 ""R9MLP ACCESS""SBUS\0 ""XJT Lite\0 ""AFHDS3\0 "