Fixed colors in Radio menus

This commit is contained in:
jfrickmann
2021-08-28 17:03:12 -04:00
parent 5fd78ce0d7
commit 29639d76ab
8 changed files with 117 additions and 124 deletions
+7 -12
View File
@@ -101,12 +101,10 @@ class ScriptEditWindow : public Page {
ScriptInputsOutputs& sio = scriptInputsOutputs[idx]; ScriptInputsOutputs& sio = scriptInputsOutputs[idx];
if (sio.inputsCount > 0) { if (sio.inputsCount > 0) {
new Subtitle(window, grid.getLineSlot(), STR_INPUTS); new Subtitle(window, grid.getLineSlot(), STR_INPUTS, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
auto gInputs = auto gInputs = new FormGroup(window, grid.getFieldSlot(), FORM_BORDER_FOCUS_ONLY | PAINT_CHILDREN_FIRST);
new FormGroup(window, grid.getFieldSlot(),
FORM_BORDER_FOCUS_ONLY | PAINT_CHILDREN_FIRST);
GridLayout inputsGrid(gInputs); GridLayout inputsGrid(gInputs);
for (int i = 0; i < sio.inputsCount; i++) { for (int i = 0; i < sio.inputsCount; i++) {
@@ -128,7 +126,7 @@ class ScriptEditWindow : public Page {
} }
if (sio.outputsCount > 0) { if (sio.outputsCount > 0) {
new Subtitle(window, grid.getLabelSlot(), STR_OUTPUTS); new Subtitle(window, grid.getLabelSlot(), STR_OUTPUTS, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
auto gOutputs = auto gOutputs =
@@ -140,12 +138,10 @@ class ScriptEditWindow : public Page {
ScriptOutput* so = &(sio.outputs[i]); ScriptOutput* so = &(sio.outputs[i]);
new DynamicText(gOutputs, outputsGrid.getLabelSlot(), [=]() { new DynamicText(gOutputs, outputsGrid.getLabelSlot(), [=]() {
char s[16]; char s[16];
getSourceString(s, getSourceString(s, MIXSRC_FIRST_LUA + (idx * MAX_SCRIPT_OUTPUTS) + i);
MIXSRC_FIRST_LUA + (idx * MAX_SCRIPT_OUTPUTS) + i);
return std::string(s, sizeof(s) - 1); return std::string(s, sizeof(s) - 1);
}); }, COLOR_THEME_PRIMARY1);
new DynamicNumber<int>(gOutputs, outputsGrid.getFieldSlot(), new DynamicNumber<int>(gOutputs, outputsGrid.getFieldSlot(), [=]() { return calcRESXto1000(so->value); }, COLOR_THEME_PRIMARY1);
[=]() { return calcRESXto1000(so->value); });
outputsGrid.nextLine(); outputsGrid.nextLine();
} }
@@ -200,8 +196,7 @@ class ScriptLineButton : public Button
switch (runtimeData->state) { switch (runtimeData->state) {
case SCRIPT_SYNTAX_ERROR: case SCRIPT_SYNTAX_ERROR:
dc->drawSizedText(x, y, SCRIPT_STATUS_ERROR, dc->drawSizedText(x, y, SCRIPT_STATUS_ERROR, sizeof(SCRIPT_STATUS_ERROR), textColor);
sizeof(SCRIPT_STATUS_ERROR), textColor);
break; break;
default: default:
dc->drawNumber(x, y, runtimeData->instructions, textColor, 0, nullptr, "%"); dc->drawNumber(x, y, runtimeData->instructions, textColor, 0, nullptr, "%");
+1 -1
View File
@@ -180,7 +180,7 @@ class SensorEditWindow : public Page {
new StaticText(sensorParametersWindow, grid.getLabelSlot(), STR_ID, 0, COLOR_THEME_PRIMARY1); new StaticText(sensorParametersWindow, grid.getLabelSlot(), STR_ID, 0, COLOR_THEME_PRIMARY1);
auto hex = new NumberEdit(sensorParametersWindow, grid.getFieldSlot(2, 0), 0, 0xFFFF, GET_SET_DEFAULT(sensor->id)); auto hex = new NumberEdit(sensorParametersWindow, grid.getFieldSlot(2, 0), 0, 0xFFFF, GET_SET_DEFAULT(sensor->id));
hex->setDisplayHandler([](BitmapBuffer * dc, LcdFlags flags, int32_t value) { hex->setDisplayHandler([](BitmapBuffer * dc, LcdFlags flags, int32_t value) {
drawHexNumber(dc, FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value, 0); drawHexNumber(dc, FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value, flags);
}); });
new NumberEdit(sensorParametersWindow, grid.getFieldSlot(2, 1), 0, 0xff, GET_SET_DEFAULT(sensor->instance)); new NumberEdit(sensorParametersWindow, grid.getFieldSlot(2, 1), 0, 0xff, GET_SET_DEFAULT(sensor->instance));
grid.nextLine(); grid.nextLine();
+28 -30
View File
@@ -37,7 +37,7 @@
class SwitchDynamicLabel: public StaticText { class SwitchDynamicLabel: public StaticText {
public: public:
SwitchDynamicLabel(Window * parent, const rect_t & rect, uint8_t index): SwitchDynamicLabel(Window * parent, const rect_t & rect, uint8_t index):
StaticText(parent, rect), StaticText(parent, rect, "", 0, COLOR_THEME_PRIMARY1),
index(index) index(index)
{ {
update(); update();
@@ -108,7 +108,7 @@ class BluetoothConfigWindow : public FormGroup
#endif #endif
clear(); clear();
new StaticText(this, grid.getLabelSlot(true), STR_MODE); new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0, COLOR_THEME_PRIMARY1);
btMode = new Choice(this, grid.getFieldSlot(), STR_BLUETOOTH_MODES, BLUETOOTH_OFF, BLUETOOTH_TRAINER, GET_DEFAULT(g_eeGeneral.bluetoothMode), [=](int32_t newValue) { btMode = new Choice(this, grid.getFieldSlot(), STR_BLUETOOTH_MODES, BLUETOOTH_OFF, BLUETOOTH_TRAINER, GET_DEFAULT(g_eeGeneral.bluetoothMode), [=](int32_t newValue) {
g_eeGeneral.bluetoothMode = newValue; g_eeGeneral.bluetoothMode = newValue;
update(); update();
@@ -120,23 +120,23 @@ class BluetoothConfigWindow : public FormGroup
if (g_eeGeneral.bluetoothMode != BLUETOOTH_OFF) { if (g_eeGeneral.bluetoothMode != BLUETOOTH_OFF) {
// Pin code (displayed for information only, not editable) // Pin code (displayed for information only, not editable)
if (g_eeGeneral.bluetoothMode == BLUETOOTH_TELEMETRY) { if (g_eeGeneral.bluetoothMode == BLUETOOTH_TELEMETRY) {
new StaticText(this, grid.getLabelSlot(true), STR_BLUETOOTH_PIN_CODE); new StaticText(this, grid.getLabelSlot(true), STR_BLUETOOTH_PIN_CODE, 0, COLOR_THEME_PRIMARY1);
new StaticText(this, grid.getFieldSlot(), "000000"); new StaticText(this, grid.getFieldSlot(), "000000", 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
} }
// Local MAC // Local MAC
new StaticText(this, grid.getLabelSlot(true), STR_BLUETOOTH_LOCAL_ADDR); new StaticText(this, grid.getLabelSlot(true), STR_BLUETOOTH_LOCAL_ADDR, 0, COLOR_THEME_PRIMARY1);
new StaticText(this, grid.getFieldSlot(), bluetooth.localAddr[0] == '\0' ? "---" : bluetooth.localAddr); new StaticText(this, grid.getFieldSlot(), bluetooth.localAddr[0] == '\0' ? "---" : bluetooth.localAddr, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Remote MAC // Remote MAC
new StaticText(this, grid.getLabelSlot(true), STR_BLUETOOTH_DIST_ADDR); new StaticText(this, grid.getLabelSlot(true), STR_BLUETOOTH_DIST_ADDR, 0, COLOR_THEME_PRIMARY1);
new StaticText(this, grid.getFieldSlot(), bluetooth.distantAddr[0] == '\0' ? "---" : bluetooth.distantAddr); new StaticText(this, grid.getFieldSlot(), bluetooth.distantAddr[0] == '\0' ? "---" : bluetooth.distantAddr, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// BT radio name // BT radio name
new StaticText(this, grid.getLabelSlot(true), STR_NAME); new StaticText(this, grid.getLabelSlot(true), STR_NAME, 0, COLOR_THEME_PRIMARY1);
new RadioTextEdit(this, grid.getFieldSlot(), g_eeGeneral.bluetoothName, LEN_BLUETOOTH_NAME); new RadioTextEdit(this, grid.getFieldSlot(), g_eeGeneral.bluetoothName, LEN_BLUETOOTH_NAME);
grid.nextLine(); grid.nextLine();
} }
@@ -160,7 +160,7 @@ void RadioHardwarePage::build(FormWindow * window)
grid.spacer(PAGE_PADDING); grid.spacer(PAGE_PADDING);
// Calibration // Calibration
new StaticText(window, grid.getLabelSlot(), STR_INPUTS, 0, FONT(BOLD)); new StaticText(window, grid.getLabelSlot(), STR_INPUTS, 0, COLOR_THEME_PRIMARY1 | FONT(BOLD));
auto calib = new TextButton(window, grid.getFieldSlot(), STR_CALIBRATION); auto calib = new TextButton(window, grid.getFieldSlot(), STR_CALIBRATION);
calib->setPressHandler([=]() -> uint8_t { calib->setPressHandler([=]() -> uint8_t {
auto calibrationPage = new RadioCalibrationPage(); auto calibrationPage = new RadioCalibrationPage();
@@ -172,19 +172,19 @@ void RadioHardwarePage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Sticks // Sticks
new Subtitle(window, grid.getLineSlot(), STR_STICKS); new Subtitle(window, grid.getLineSlot(), STR_STICKS, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
for (int i = 0; i < NUM_STICKS; i++) { for (int i = 0; i < NUM_STICKS; i++) {
new StaticText(window, grid.getLabelSlot(true), TEXT_AT_INDEX(STR_VSRCRAW, (i + 1))); new StaticText(window, grid.getLabelSlot(true), TEXT_AT_INDEX(STR_VSRCRAW, (i + 1)), 0, COLOR_THEME_PRIMARY1);
new RadioTextEdit(window, grid.getFieldSlot(2,0), g_eeGeneral.anaNames[i], LEN_ANA_NAME); new RadioTextEdit(window, grid.getFieldSlot(2,0), g_eeGeneral.anaNames[i], LEN_ANA_NAME);
grid.nextLine(); grid.nextLine();
} }
// Pots // Pots
new Subtitle(window, grid.getLineSlot(), STR_POTS); new Subtitle(window, grid.getLineSlot(), STR_POTS, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
for (int i = 0; i < NUM_POTS; i++) { for (int i = 0; i < NUM_POTS; i++) {
new StaticText(window, grid.getLabelSlot(true), TEXT_AT_INDEX(STR_VSRCRAW, (i + NUM_STICKS + 1))); new StaticText(window, grid.getLabelSlot(true), TEXT_AT_INDEX(STR_VSRCRAW, (i + NUM_STICKS + 1)), 0, COLOR_THEME_PRIMARY1);
new RadioTextEdit(window, grid.getFieldSlot(2,0), g_eeGeneral.anaNames[i + NUM_STICKS], LEN_ANA_NAME); new RadioTextEdit(window, grid.getFieldSlot(2,0), g_eeGeneral.anaNames[i + NUM_STICKS], LEN_ANA_NAME);
new Choice(window, grid.getFieldSlot(2,1), STR_POTTYPES, POT_NONE, POT_WITHOUT_DETENT, new Choice(window, grid.getFieldSlot(2,1), STR_POTTYPES, POT_NONE, POT_WITHOUT_DETENT,
[=]() -> int { [=]() -> int {
@@ -198,14 +198,12 @@ void RadioHardwarePage::build(FormWindow * window)
} }
// Sliders // Sliders
new Subtitle(window, grid.getLineSlot(), STR_SLIDERS); new Subtitle(window, grid.getLineSlot(), STR_SLIDERS, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
for (int i = 0; i < NUM_SLIDERS; i++) { for (int i = 0; i < NUM_SLIDERS; i++) {
const int idx = i + NUM_STICKS + NUM_POTS; const int idx = i + NUM_STICKS + NUM_POTS;
new StaticText(window, grid.getLabelSlot(true), new StaticText(window, grid.getLabelSlot(true), TEXT_AT_INDEX(STR_VSRCRAW, idx + 1), 0, COLOR_THEME_PRIMARY1);
TEXT_AT_INDEX(STR_VSRCRAW, idx + 1)); new RadioTextEdit(window, grid.getFieldSlot(2, 0), g_eeGeneral.anaNames[idx], LEN_ANA_NAME);
new RadioTextEdit(window, grid.getFieldSlot(2, 0),
g_eeGeneral.anaNames[idx], LEN_ANA_NAME);
new Choice( new Choice(
window, grid.getFieldSlot(2, 1), STR_SLIDERTYPES, SLIDER_NONE, window, grid.getFieldSlot(2, 1), STR_SLIDERTYPES, SLIDER_NONE,
SLIDER_WITH_DETENT, SLIDER_WITH_DETENT,
@@ -223,7 +221,7 @@ void RadioHardwarePage::build(FormWindow * window)
} }
// Switches // Switches
new Subtitle(window, grid.getLineSlot(), STR_SWITCHES); new Subtitle(window, grid.getLineSlot(), STR_SWITCHES, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
for (int i = 0; i < NUM_SWITCHES; i++) { for (int i = 0; i < NUM_SWITCHES; i++) {
new SwitchDynamicLabel(window, grid.getLabelSlot(true), i); new SwitchDynamicLabel(window, grid.getLabelSlot(true), i);
@@ -241,7 +239,7 @@ void RadioHardwarePage::build(FormWindow * window)
} }
// Bat calibration // Bat calibration
new StaticText(window, grid.getLabelSlot(), STR_BATT_CALIB); new StaticText(window, grid.getLabelSlot(), STR_BATT_CALIB, 0, COLOR_THEME_PRIMARY1);
auto batCal = new NumberEdit(window, grid.getFieldSlot(1,0), -127, 127, GET_SET_DEFAULT(g_eeGeneral.txVoltageCalibration)); auto batCal = new NumberEdit(window, grid.getFieldSlot(1,0), -127, 127, GET_SET_DEFAULT(g_eeGeneral.txVoltageCalibration));
batCal->setDisplayHandler([](BitmapBuffer * dc, LcdFlags flags, int32_t value) { batCal->setDisplayHandler([](BitmapBuffer * dc, LcdFlags flags, int32_t value) {
dc->drawNumber(FIELD_PADDING_LEFT, FIELD_PADDING_TOP, getBatteryVoltage(), flags | PREC2, 0, nullptr, "V"); dc->drawNumber(FIELD_PADDING_LEFT, FIELD_PADDING_TOP, getBatteryVoltage(), flags | PREC2, 0, nullptr, "V");
@@ -250,20 +248,20 @@ void RadioHardwarePage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// RTC Batt display // RTC Batt display
new StaticText(window, grid.getLabelSlot(), STR_RTC_BATT); new StaticText(window, grid.getLabelSlot(), STR_RTC_BATT, 0, COLOR_THEME_PRIMARY1);
new DynamicNumber<uint16_t>(window, grid.getFieldSlot(1,0), [] { new DynamicNumber<uint16_t>(window, grid.getFieldSlot(1,0), [] {
return getRTCBatteryVoltage(); return getRTCBatteryVoltage();
}, PREC2, nullptr, "V"); }, COLOR_THEME_PRIMARY1 | PREC2, nullptr, "V");
grid.nextLine(); grid.nextLine();
// RTC Batt check enable // RTC Batt check enable
new StaticText(window, grid.getLabelSlot(), STR_RTC_CHECK); new StaticText(window, grid.getLabelSlot(), STR_RTC_CHECK, 0, COLOR_THEME_PRIMARY1);
new CheckBox(window, grid.getFieldSlot(1,0), GET_SET_INVERTED(g_eeGeneral.disableRtcWarning )); new CheckBox(window, grid.getFieldSlot(1,0), GET_SET_INVERTED(g_eeGeneral.disableRtcWarning ));
grid.nextLine(); grid.nextLine();
#if defined(CROSSFIRE) && SPORT_MAX_BAUDRATE < 400000 #if defined(CROSSFIRE) && SPORT_MAX_BAUDRATE < 400000
// Max baud for external modules // Max baud for external modules
new StaticText(window, grid.getLabelSlot(), STR_MAXBAUDRATE); new StaticText(window, grid.getLabelSlot(), STR_MAXBAUDRATE, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(1,0), STR_CRSF_BAUDRATE, 0, 1, GET_SET_DEFAULT(g_eeGeneral.telemetryBaudrate)); new Choice(window, grid.getFieldSlot(1,0), STR_CRSF_BAUDRATE, 0, 1, GET_SET_DEFAULT(g_eeGeneral.telemetryBaudrate));
grid.nextLine(); grid.nextLine();
#endif #endif
@@ -271,14 +269,14 @@ void RadioHardwarePage::build(FormWindow * window)
#if defined(BLUETOOTH) #if defined(BLUETOOTH)
// Bluetooth mode // Bluetooth mode
{ {
new Subtitle(window, grid.getLineSlot(), STR_BLUETOOTH); new Subtitle(window, grid.getLineSlot(), STR_BLUETOOTH, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
grid.addWindow(new BluetoothConfigWindow(window, {0, grid.getWindowHeight(), LCD_W, 0})); grid.addWindow(new BluetoothConfigWindow(window, {0, grid.getWindowHeight(), LCD_W, 0}));
} }
#endif #endif
#if defined(AUX_SERIAL) #if defined(AUX_SERIAL)
new StaticText(window, grid.getLabelSlot(), STR_AUX_SERIAL_MODE); new StaticText(window, grid.getLabelSlot(), STR_AUX_SERIAL_MODE, 0, COLOR_THEME_PRIMARY1);
auto aux = auto aux =
new Choice(window, grid.getFieldSlot(1, 0), STR_AUX_SERIAL_MODES, 0, new Choice(window, grid.getFieldSlot(1, 0), STR_AUX_SERIAL_MODES, 0,
UART_MODE_MAX, GET_DEFAULT(g_eeGeneral.auxSerialMode), UART_MODE_MAX, GET_DEFAULT(g_eeGeneral.auxSerialMode),
@@ -292,7 +290,7 @@ void RadioHardwarePage::build(FormWindow * window)
#endif #endif
#if defined(AUX2_SERIAL) #if defined(AUX2_SERIAL)
new StaticText(window, grid.getLabelSlot(), STR_AUX2_SERIAL_MODE); new StaticText(window, grid.getLabelSlot(), STR_AUX2_SERIAL_MODE, 0, COLOR_THEME_PRIMARY1);
auto aux2 = auto aux2 =
new Choice(window, grid.getFieldSlot(1, 0), STR_AUX_SERIAL_MODES, 0, new Choice(window, grid.getFieldSlot(1, 0), STR_AUX_SERIAL_MODES, 0,
UART_MODE_MAX, GET_DEFAULT(g_eeGeneral.aux2SerialMode), UART_MODE_MAX, GET_DEFAULT(g_eeGeneral.aux2SerialMode),
@@ -311,12 +309,12 @@ void RadioHardwarePage::build(FormWindow * window)
#endif #endif
// ADC filter // ADC filter
new StaticText(window, grid.getLabelSlot(), STR_JITTER_FILTER); new StaticText(window, grid.getLabelSlot(), STR_JITTER_FILTER, 0, COLOR_THEME_PRIMARY1);
new CheckBox(window, grid.getFieldSlot(1,0), GET_SET_INVERTED(g_eeGeneral.jitterFilter)); new CheckBox(window, grid.getFieldSlot(1,0), GET_SET_INVERTED(g_eeGeneral.jitterFilter));
grid.nextLine(); grid.nextLine();
// Debugs // Debugs
new StaticText(window, grid.getLabelSlot(), STR_DEBUG, 0, FONT(BOLD)); new StaticText(window, grid.getLabelSlot(), STR_DEBUG, 0, COLOR_THEME_PRIMARY1 | FONT(BOLD));
auto debugAnas = new TextButton(window, grid.getFieldSlot(2, 0), STR_ANALOGS_BTN); auto debugAnas = new TextButton(window, grid.getFieldSlot(2, 0), STR_ANALOGS_BTN);
debugAnas->setPressHandler([=]() -> uint8_t { debugAnas->setPressHandler([=]() -> uint8_t {
auto debugAnalogsPage = new RadioAnalogsDiagsPage(); auto debugAnalogsPage = new RadioAnalogsDiagsPage();
+44 -44
View File
@@ -52,7 +52,7 @@ class DateTimeWindow : public FormGroup {
FormGridLayout grid; FormGridLayout grid;
// Date // Date
new StaticText(this, grid.getLabelSlot(), STR_DATE); new StaticText(this, grid.getLabelSlot(), STR_DATE, 0, COLOR_THEME_PRIMARY1);
new NumberEdit(this, grid.getFieldSlot(3, 0), 2018, 2100, new NumberEdit(this, grid.getFieldSlot(3, 0), 2018, 2100,
[=]() -> int32_t { [=]() -> int32_t {
struct gtm t; struct gtm t;
@@ -105,7 +105,7 @@ class DateTimeWindow : public FormGroup {
grid.nextLine(); grid.nextLine();
// Time // Time
new StaticText(this, grid.getLabelSlot(), STR_TIME); new StaticText(this, grid.getLabelSlot(), STR_TIME, 0, COLOR_THEME_PRIMARY1);
auto hour = new NumberEdit(this, grid.getFieldSlot(3, 0), 0, 24, auto hour = new NumberEdit(this, grid.getFieldSlot(3, 0), 0, 24,
[=]() -> int32_t { [=]() -> int32_t {
struct gtm t; struct gtm t;
@@ -171,7 +171,7 @@ void RadioSetupPage::build(FormWindow * window)
grid.addWindow(timeWindow); grid.addWindow(timeWindow);
// Batt meter range - Range 3.0v to 16v // Batt meter range - Range 3.0v to 16v
new StaticText(window, grid.getLabelSlot(), STR_BATTERY_RANGE); new StaticText(window, grid.getLabelSlot(), STR_BATTERY_RANGE, 0, COLOR_THEME_PRIMARY1);
auto batMinEdit = new NumberEdit(window, grid.getFieldSlot(2, 0), -60 + 90, g_eeGeneral.vBatMax + 29 + 90, GET_SET_WITH_OFFSET(g_eeGeneral.vBatMin, 90), 0, PREC1); auto batMinEdit = new NumberEdit(window, grid.getFieldSlot(2, 0), -60 + 90, g_eeGeneral.vBatMax + 29 + 90, GET_SET_WITH_OFFSET(g_eeGeneral.vBatMin, 90), 0, PREC1);
batMinEdit->setSuffix("V"); batMinEdit->setSuffix("V");
auto batMaxEdit = new NumberEdit(window, grid.getFieldSlot(2, 1), g_eeGeneral.vBatMin - 29 + 120, 40 + 120, GET_SET_WITH_OFFSET(g_eeGeneral.vBatMax, 120), 0, PREC1); auto batMaxEdit = new NumberEdit(window, grid.getFieldSlot(2, 1), g_eeGeneral.vBatMin - 29 + 120, 40 + 120, GET_SET_WITH_OFFSET(g_eeGeneral.vBatMax, 120), 0, PREC1);
@@ -190,31 +190,31 @@ void RadioSetupPage::build(FormWindow * window)
}); });
grid.nextLine(); grid.nextLine();
new Subtitle(window, grid.getLabelSlot(), STR_SOUND_LABEL); new Subtitle(window, grid.getLabelSlot(), STR_SOUND_LABEL, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Beeps mode // Beeps mode
new StaticText(window, grid.getLabelSlot(true), STR_SPEAKER); new StaticText(window, grid.getLabelSlot(true), STR_SPEAKER, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(), STR_VBEEPMODE, -2, 1, GET_SET_DEFAULT(g_eeGeneral.beepMode)); new Choice(window, grid.getFieldSlot(), STR_VBEEPMODE, -2, 1, GET_SET_DEFAULT(g_eeGeneral.beepMode));
grid.nextLine(); grid.nextLine();
// Main volume // Main volume
new StaticText(window, grid.getLabelSlot(true), STR_VOLUME); new StaticText(window, grid.getLabelSlot(true), STR_VOLUME, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -VOLUME_LEVEL_DEF, VOLUME_LEVEL_MAX-VOLUME_LEVEL_DEF, GET_SET_DEFAULT(g_eeGeneral.speakerVolume)); new Slider(window, grid.getFieldSlot(), -VOLUME_LEVEL_DEF, VOLUME_LEVEL_MAX-VOLUME_LEVEL_DEF, GET_SET_DEFAULT(g_eeGeneral.speakerVolume));
grid.nextLine(); grid.nextLine();
// Beeps volume // Beeps volume
new StaticText(window, grid.getLabelSlot(true), STR_BEEP_VOLUME); new StaticText(window, grid.getLabelSlot(true), STR_BEEP_VOLUME, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.beepVolume)); new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.beepVolume));
grid.nextLine(); grid.nextLine();
// Beeps length // Beeps length
new StaticText(window, grid.getLabelSlot(true), STR_BEEP_LENGTH); new StaticText(window, grid.getLabelSlot(true), STR_BEEP_LENGTH, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.beepLength)); new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.beepLength));
grid.nextLine(); grid.nextLine();
// Beeps pitch // Beeps pitch
new StaticText(window, grid.getLabelSlot(true), STR_BEEP_PITCH); new StaticText(window, grid.getLabelSlot(true), STR_BEEP_PITCH, 0, COLOR_THEME_PRIMARY1);
auto edit = new NumberEdit(window, grid.getFieldSlot(), 0, 300, auto edit = new NumberEdit(window, grid.getFieldSlot(), 0, 300,
GET_DEFAULT(15 * g_eeGeneral.speakerPitch), GET_DEFAULT(15 * g_eeGeneral.speakerPitch),
[=](int32_t newValue) { [=](int32_t newValue) {
@@ -227,26 +227,26 @@ void RadioSetupPage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Wav volume // Wav volume
new StaticText(window, grid.getLabelSlot(true), STR_WAV_VOLUME); new StaticText(window, grid.getLabelSlot(true), STR_WAV_VOLUME, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.wavVolume)); new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.wavVolume));
grid.nextLine(); grid.nextLine();
// Background volume // Background volume
new StaticText(window, grid.getLabelSlot(true), STR_BG_VOLUME); new StaticText(window, grid.getLabelSlot(true), STR_BG_VOLUME, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.backgroundVolume)); new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.backgroundVolume));
grid.nextLine(); grid.nextLine();
#if defined(VARIO) #if defined(VARIO)
{ {
new Subtitle(window, grid.getLabelSlot(), STR_VARIO); new Subtitle(window, grid.getLabelSlot(), STR_VARIO, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Vario volume // Vario volume
new StaticText(window, grid.getLabelSlot(true), TR_VOLUME); new StaticText(window, grid.getLabelSlot(true), TR_VOLUME, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.varioVolume)); new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.varioVolume));
grid.nextLine(); grid.nextLine();
new StaticText(window, grid.getLabelSlot(true), STR_PITCH_AT_ZERO); new StaticText(window, grid.getLabelSlot(true), STR_PITCH_AT_ZERO, 0, COLOR_THEME_PRIMARY1);
edit = new NumberEdit(window, grid.getFieldSlot(), VARIO_FREQUENCY_ZERO - 400, VARIO_FREQUENCY_ZERO + 400, edit = new NumberEdit(window, grid.getFieldSlot(), VARIO_FREQUENCY_ZERO - 400, VARIO_FREQUENCY_ZERO + 400,
GET_DEFAULT(VARIO_FREQUENCY_ZERO + (g_eeGeneral.varioPitch * 10)), GET_DEFAULT(VARIO_FREQUENCY_ZERO + (g_eeGeneral.varioPitch * 10)),
SET_VALUE(g_eeGeneral.varioPitch, (newValue - VARIO_FREQUENCY_ZERO) / 10)); SET_VALUE(g_eeGeneral.varioPitch, (newValue - VARIO_FREQUENCY_ZERO) / 10));
@@ -254,7 +254,7 @@ void RadioSetupPage::build(FormWindow * window)
edit->setSuffix("Hz"); edit->setSuffix("Hz");
grid.nextLine(); grid.nextLine();
new StaticText(window, grid.getLabelSlot(true), STR_PITCH_AT_MAX); new StaticText(window, grid.getLabelSlot(true), STR_PITCH_AT_MAX, 0, COLOR_THEME_PRIMARY1);
edit = new NumberEdit(window, grid.getFieldSlot(), 900, 2500, edit = new NumberEdit(window, grid.getFieldSlot(), 900, 2500,
GET_DEFAULT(VARIO_FREQUENCY_ZERO + (g_eeGeneral.varioPitch * 10) + VARIO_FREQUENCY_RANGE + (g_eeGeneral.varioRange * 10)), GET_DEFAULT(VARIO_FREQUENCY_ZERO + (g_eeGeneral.varioPitch * 10) + VARIO_FREQUENCY_RANGE + (g_eeGeneral.varioRange * 10)),
SET_VALUE(g_eeGeneral.varioRange, (newValue - VARIO_FREQUENCY_ZERO - VARIO_FREQUENCY_RANGE) / 10 - g_eeGeneral.varioPitch )); SET_VALUE(g_eeGeneral.varioRange, (newValue - VARIO_FREQUENCY_ZERO - VARIO_FREQUENCY_RANGE) / 10 - g_eeGeneral.varioPitch ));
@@ -262,7 +262,7 @@ void RadioSetupPage::build(FormWindow * window)
edit->setSuffix("Hz"); edit->setSuffix("Hz");
grid.nextLine(); grid.nextLine();
new StaticText(window, grid.getLabelSlot(true), STR_REPEAT_AT_ZERO); new StaticText(window, grid.getLabelSlot(true), STR_REPEAT_AT_ZERO, 0, COLOR_THEME_PRIMARY1);
edit = new NumberEdit(window, grid.getFieldSlot(), 200, 1000, edit = new NumberEdit(window, grid.getFieldSlot(), 200, 1000,
GET_DEFAULT(VARIO_REPEAT_ZERO + (g_eeGeneral.varioRepeat * 10)), GET_DEFAULT(VARIO_REPEAT_ZERO + (g_eeGeneral.varioRepeat * 10)),
SET_VALUE(g_eeGeneral.varioRepeat, (newValue - VARIO_REPEAT_ZERO) / 10)); SET_VALUE(g_eeGeneral.varioRepeat, (newValue - VARIO_REPEAT_ZERO) / 10));
@@ -274,21 +274,21 @@ void RadioSetupPage::build(FormWindow * window)
#if defined(HAPTIC) #if defined(HAPTIC)
{ {
new Subtitle(window, grid.getLabelSlot(), STR_HAPTIC_LABEL); new Subtitle(window, grid.getLabelSlot(), STR_HAPTIC_LABEL, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Haptic mode // Haptic mode
new StaticText(window, grid.getLabelSlot(true), STR_MODE); new StaticText(window, grid.getLabelSlot(true), STR_MODE, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(), STR_VBEEPMODE, -2, 1, GET_SET_DEFAULT(g_eeGeneral.hapticMode)); new Choice(window, grid.getFieldSlot(), STR_VBEEPMODE, -2, 1, GET_SET_DEFAULT(g_eeGeneral.hapticMode));
grid.nextLine(); grid.nextLine();
// Haptic duration // Haptic duration
new StaticText(window, grid.getLabelSlot(true), STR_LENGTH); new StaticText(window, grid.getLabelSlot(true), STR_LENGTH, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.hapticLength)); new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.hapticLength));
grid.nextLine(); grid.nextLine();
// Haptic strength // Haptic strength
new StaticText(window, grid.getLabelSlot(true), STR_STRENGTH); new StaticText(window, grid.getLabelSlot(true), STR_STRENGTH, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.hapticStrength)); new Slider(window, grid.getFieldSlot(), -2, +2, GET_SET_DEFAULT(g_eeGeneral.hapticStrength));
grid.nextLine(); grid.nextLine();
} }
@@ -296,39 +296,39 @@ void RadioSetupPage::build(FormWindow * window)
// Alarms // Alarms
{ {
new Subtitle(window, grid.getLabelSlot(), STR_ALARMS_LABEL); new Subtitle(window, grid.getLabelSlot(), STR_ALARMS_LABEL, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Battery warning // Battery warning
new StaticText(window, grid.getLabelSlot(true), STR_BATTERYWARNING); new StaticText(window, grid.getLabelSlot(true), STR_BATTERYWARNING, 0, COLOR_THEME_PRIMARY1);
edit = new NumberEdit(window, grid.getFieldSlot(), 30, 120, GET_SET_DEFAULT(g_eeGeneral.vBatWarn), 0, PREC1); edit = new NumberEdit(window, grid.getFieldSlot(), 30, 120, GET_SET_DEFAULT(g_eeGeneral.vBatWarn), 0, PREC1);
edit->setSuffix("V"); edit->setSuffix("V");
grid.nextLine(); grid.nextLine();
// Inactivity alarm // Inactivity alarm
new StaticText(window, grid.getLabelSlot(true), STR_INACTIVITYALARM); new StaticText(window, grid.getLabelSlot(true), STR_INACTIVITYALARM, 0, COLOR_THEME_PRIMARY1);
edit = new NumberEdit(window, grid.getFieldSlot(), 0, 250, GET_SET_DEFAULT(g_eeGeneral.inactivityTimer)); edit = new NumberEdit(window, grid.getFieldSlot(), 0, 250, GET_SET_DEFAULT(g_eeGeneral.inactivityTimer));
edit->setSuffix("minutes"); edit->setSuffix("minutes");
grid.nextLine(); grid.nextLine();
// Alarms warning // Alarms warning
new StaticText(window, grid.getLabelSlot(true), STR_ALARMWARNING); new StaticText(window, grid.getLabelSlot(true), STR_ALARMWARNING, 0, COLOR_THEME_PRIMARY1);
new CheckBox(window, grid.getFieldSlot(), GET_SET_INVERTED(g_eeGeneral.disableAlarmWarning)); new CheckBox(window, grid.getFieldSlot(), GET_SET_INVERTED(g_eeGeneral.disableAlarmWarning));
grid.nextLine(); grid.nextLine();
// RSSI shutdown alarm // RSSI shutdown alarm
new StaticText(window, grid.getLabelSlot(true), STR_RSSI_SHUTDOWN_ALARM); new StaticText(window, grid.getLabelSlot(true), STR_RSSI_SHUTDOWN_ALARM, 0, COLOR_THEME_PRIMARY1);
new CheckBox(window, grid.getFieldSlot(), GET_SET_INVERTED(g_eeGeneral.disableRssiPoweroffAlarm)); new CheckBox(window, grid.getFieldSlot(), GET_SET_INVERTED(g_eeGeneral.disableRssiPoweroffAlarm));
grid.nextLine(); grid.nextLine();
} }
// Backlight // Backlight
{ {
new Subtitle(window, grid.getLabelSlot(), STR_BACKLIGHT_LABEL); new Subtitle(window, grid.getLabelSlot(), STR_BACKLIGHT_LABEL, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Backlight mode // Backlight mode
new StaticText(window, grid.getLabelSlot(true), STR_MODE); new StaticText(window, grid.getLabelSlot(true), STR_MODE, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(2,0), STR_VBLMODE, e_backlight_mode_off, e_backlight_mode_on, GET_SET_DEFAULT(g_eeGeneral.backlightMode)); new Choice(window, grid.getFieldSlot(2,0), STR_VBLMODE, e_backlight_mode_off, e_backlight_mode_on, GET_SET_DEFAULT(g_eeGeneral.backlightMode));
//grid.nextLine(); //grid.nextLine();
@@ -341,7 +341,7 @@ void RadioSetupPage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Backlight ON bright // Backlight ON bright
new StaticText(window, grid.getLabelSlot(true), STR_BLONBRIGHTNESS); new StaticText(window, grid.getLabelSlot(true), STR_BLONBRIGHTNESS, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), BACKLIGHT_LEVEL_MIN, BACKLIGHT_LEVEL_MAX, new Slider(window, grid.getFieldSlot(), BACKLIGHT_LEVEL_MIN, BACKLIGHT_LEVEL_MAX,
[=]() -> int32_t { [=]() -> int32_t {
return BACKLIGHT_LEVEL_MAX - g_eeGeneral.backlightBright; return BACKLIGHT_LEVEL_MAX - g_eeGeneral.backlightBright;
@@ -352,19 +352,19 @@ void RadioSetupPage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Backlight OFF bright // Backlight OFF bright
new StaticText(window, grid.getLabelSlot(true), STR_BLOFFBRIGHTNESS); new StaticText(window, grid.getLabelSlot(true), STR_BLOFFBRIGHTNESS, 0, COLOR_THEME_PRIMARY1);
new Slider(window, grid.getFieldSlot(), BACKLIGHT_LEVEL_MIN, BACKLIGHT_LEVEL_MAX, GET_SET_DEFAULT(g_eeGeneral.blOffBright)); new Slider(window, grid.getFieldSlot(), BACKLIGHT_LEVEL_MIN, BACKLIGHT_LEVEL_MAX, GET_SET_DEFAULT(g_eeGeneral.blOffBright));
grid.nextLine(); grid.nextLine();
#if defined(KEYS_BACKLIGHT_GPIO) #if defined(KEYS_BACKLIGHT_GPIO)
// Keys backlight // Keys backlight
new StaticText(window, grid.getLabelSlot(true), STR_KEYS_BACKLIGHT); new StaticText(window, grid.getLabelSlot(true), STR_KEYS_BACKLIGHT, 0, COLOR_THEME_PRIMARY1);
new CheckBox(window, grid.getFieldSlot(), GET_SET_DEFAULT(g_eeGeneral.keysBacklight)); new CheckBox(window, grid.getFieldSlot(), GET_SET_DEFAULT(g_eeGeneral.keysBacklight));
grid.nextLine(); grid.nextLine();
#endif #endif
// Flash beep // Flash beep
new StaticText(window, grid.getLabelSlot(true), STR_ALARM); new StaticText(window, grid.getLabelSlot(true), STR_ALARM, 0, COLOR_THEME_PRIMARY1);
new CheckBox(window, grid.getFieldSlot(), GET_SET_DEFAULT(g_eeGeneral.alarmsFlash)); new CheckBox(window, grid.getFieldSlot(), GET_SET_DEFAULT(g_eeGeneral.alarmsFlash));
grid.nextLine(); grid.nextLine();
} }
@@ -372,7 +372,7 @@ void RadioSetupPage::build(FormWindow * window)
#if defined(PWR_BUTTON_PRESS) #if defined(PWR_BUTTON_PRESS)
// Pwr Off Delay // Pwr Off Delay
{ {
new StaticText(window, grid.getLabelSlot(), STR_PWR_OFF_DELAY); new StaticText(window, grid.getLabelSlot(), STR_PWR_OFF_DELAY, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(), STR_PWR_OFF_DELAYS, 0, 3, new Choice(window, grid.getFieldSlot(), STR_PWR_OFF_DELAYS, 0, 3,
[=]() -> int32_t { [=]() -> int32_t {
return 2 - g_eeGeneral.pwrOffSpeed; return 2 - g_eeGeneral.pwrOffSpeed;
@@ -388,21 +388,21 @@ void RadioSetupPage::build(FormWindow * window)
#if defined(INTERNAL_GPS) #if defined(INTERNAL_GPS)
// GPS // GPS
{ {
new Subtitle(window, grid.getLabelSlot(), STR_GPS); new Subtitle(window, grid.getLabelSlot(), STR_GPS, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Timezone // Timezone
new StaticText(window, grid.getLabelSlot(true), STR_TIMEZONE); new StaticText(window, grid.getLabelSlot(true), STR_TIMEZONE, 0, COLOR_THEME_PRIMARY1);
new NumberEdit(window, grid.getFieldSlot(), -12, 12, GET_SET_DEFAULT(g_eeGeneral.timezone)); new NumberEdit(window, grid.getFieldSlot(), -12, 12, GET_SET_DEFAULT(g_eeGeneral.timezone));
grid.nextLine(); grid.nextLine();
// Adjust RTC (from telemetry) // Adjust RTC (from telemetry)
new StaticText(window, grid.getLabelSlot(true), STR_ADJUST_RTC); new StaticText(window, grid.getLabelSlot(true), STR_ADJUST_RTC, 0, COLOR_THEME_PRIMARY1);
new CheckBox(window, grid.getFieldSlot(), GET_SET_DEFAULT(g_eeGeneral.adjustRTC)); new CheckBox(window, grid.getFieldSlot(), GET_SET_DEFAULT(g_eeGeneral.adjustRTC));
grid.nextLine(); grid.nextLine();
// GPS format // GPS format
new StaticText(window, grid.getLabelSlot(true), STR_GPS_COORDS_FORMAT); new StaticText(window, grid.getLabelSlot(true), STR_GPS_COORDS_FORMAT, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(), STR_GPSFORMAT, 0, 1, GET_SET_DEFAULT(g_eeGeneral.gpsFormat)); new Choice(window, grid.getFieldSlot(), STR_GPSFORMAT, 0, 1, GET_SET_DEFAULT(g_eeGeneral.gpsFormat));
grid.nextLine(); grid.nextLine();
} }
@@ -410,18 +410,18 @@ void RadioSetupPage::build(FormWindow * window)
#if defined(PXX2) #if defined(PXX2)
// Owner ID // Owner ID
new StaticText(window, grid.getLabelSlot(), STR_OWNER_ID); new StaticText(window, grid.getLabelSlot(), STR_OWNER_ID, 0, COLOR_THEME_PRIMARY1);
new RadioTextEdit(window, grid.getFieldSlot(), g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID); new RadioTextEdit(window, grid.getFieldSlot(), g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID);
grid.nextLine(); grid.nextLine();
#endif #endif
// Country code // Country code
new StaticText(window, grid.getLabelSlot(), STR_COUNTRY_CODE); new StaticText(window, grid.getLabelSlot(), STR_COUNTRY_CODE, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(), STR_COUNTRY_CODES, 0, 2, GET_SET_DEFAULT(g_eeGeneral.countryCode)); new Choice(window, grid.getFieldSlot(), STR_COUNTRY_CODES, 0, 2, GET_SET_DEFAULT(g_eeGeneral.countryCode));
grid.nextLine(); grid.nextLine();
// Audio language // Audio language
new StaticText(window, grid.getLabelSlot(), STR_VOICE_LANGUAGE); new StaticText(window, grid.getLabelSlot(), STR_VOICE_LANGUAGE, 0, COLOR_THEME_PRIMARY1);
auto choice = new Choice(window, grid.getFieldSlot(), 0, DIM(languagePacks) - 2, GET_VALUE(currentLanguagePackIdx), auto choice = new Choice(window, grid.getFieldSlot(), 0, DIM(languagePacks) - 2, GET_VALUE(currentLanguagePackIdx),
[](uint8_t newValue) { [](uint8_t newValue) {
currentLanguagePackIdx = newValue; currentLanguagePackIdx = newValue;
@@ -434,7 +434,7 @@ void RadioSetupPage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Imperial units // Imperial units
new StaticText(window, grid.getLabelSlot(), STR_UNITS_SYSTEM); new StaticText(window, grid.getLabelSlot(), STR_UNITS_SYSTEM, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(), STR_VUNITSSYSTEM, 0, 1, GET_SET_DEFAULT(g_eeGeneral.imperial)); new Choice(window, grid.getFieldSlot(), STR_VUNITSSYSTEM, 0, 1, GET_SET_DEFAULT(g_eeGeneral.imperial));
grid.nextLine(); grid.nextLine();
@@ -455,18 +455,18 @@ void RadioSetupPage::build(FormWindow * window)
#endif #endif
// Switches delay // Switches delay
new StaticText(window, grid.getLabelSlot(), STR_SWITCHES_DELAY); new StaticText(window, grid.getLabelSlot(), STR_SWITCHES_DELAY, 0, COLOR_THEME_PRIMARY1);
edit = new NumberEdit(window, grid.getFieldSlot(2, 0), -15, 100 - 15, GET_SET_VALUE_WITH_OFFSET(g_eeGeneral.switchesDelay, 15)); edit = new NumberEdit(window, grid.getFieldSlot(2, 0), -15, 100 - 15, GET_SET_VALUE_WITH_OFFSET(g_eeGeneral.switchesDelay, 15));
edit->setSuffix(std::string("0") + STR_MS); edit->setSuffix(std::string("0") + STR_MS);
grid.nextLine(); grid.nextLine();
// USB mode // USB mode
new StaticText(window, grid.getLabelSlot(), STR_USBMODE); new StaticText(window, grid.getLabelSlot(), STR_USBMODE, 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(), STR_USBMODES, USB_UNSELECTED_MODE, USB_MAX_MODE, GET_SET_DEFAULT(g_eeGeneral.USBMode)); new Choice(window, grid.getFieldSlot(), STR_USBMODES, USB_UNSELECTED_MODE, USB_MAX_MODE, GET_SET_DEFAULT(g_eeGeneral.USBMode));
grid.nextLine(); grid.nextLine();
// RX channel order // RX channel order
new StaticText(window, grid.getLabelSlot(), STR_RXCHANNELORD); // RAET->AETR new StaticText(window, grid.getLabelSlot(), STR_RXCHANNELORD, 0, COLOR_THEME_PRIMARY1); // RAET->AETR
choice = new Choice(window, grid.getFieldSlot(), 0, 4*3*2 - 1, GET_SET_DEFAULT(g_eeGeneral.templateSetup)); choice = new Choice(window, grid.getFieldSlot(), 0, 4*3*2 - 1, GET_SET_DEFAULT(g_eeGeneral.templateSetup));
choice->setTextHandler([](uint8_t value) { choice->setTextHandler([](uint8_t value) {
char s[5]; char s[5];
@@ -479,7 +479,7 @@ void RadioSetupPage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Stick mode // Stick mode
new StaticText(window, grid.getLabelSlot(), STR_MODE); new StaticText(window, grid.getLabelSlot(), STR_MODE, 0, COLOR_THEME_PRIMARY1);
choice = new Choice(window, grid.getFieldSlot(), 0, 3, GET_DEFAULT(g_eeGeneral.stickMode), choice = new Choice(window, grid.getFieldSlot(), 0, 3, GET_DEFAULT(g_eeGeneral.stickMode),
[=](uint8_t newValue) { [=](uint8_t newValue) {
pausePulses(); pausePulses();
+6 -6
View File
@@ -113,7 +113,7 @@ void RadioToolsPage::rebuild(FormWindow * window)
label = getBasename(path); label = getBasename(path);
} }
auto txt = new StaticText(window, grid.getLabelSlot(), "lua", auto txt = new StaticText(window, grid.getLabelSlot(), "lua",
BUTTON_BACKGROUND, CENTERED); BUTTON_BACKGROUND, COLOR_THEME_PRIMARY1 | CENTERED);
std::string path_str(path); std::string path_str(path);
auto b = new TextButton( auto b = new TextButton(
@@ -137,7 +137,7 @@ void RadioToolsPage::rebuild(FormWindow * window)
txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED); txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED);
} else { } else {
txt->setBackgroundColor(COLOR_THEME_SECONDARY2); txt->setBackgroundColor(COLOR_THEME_SECONDARY2);
txt->setTextFlags(CENTERED); txt->setTextFlags(COLOR_THEME_PRIMARY1 | CENTERED);
} }
txt->invalidate(); txt->invalidate();
}); });
@@ -181,7 +181,7 @@ void RadioToolsPage::rebuild(FormWindow * window)
.information.modelID, .information.modelID,
MODULE_OPTION_POWER_METER)) { MODULE_OPTION_POWER_METER)) {
auto txt = new StaticText(window, grid.getLabelSlot(), "access", auto txt = new StaticText(window, grid.getLabelSlot(), "access",
BUTTON_BACKGROUND, CENTERED); BUTTON_BACKGROUND, COLOR_THEME_PRIMARY1 | CENTERED);
auto b = new TextButton( auto b = new TextButton(
window, grid.getFieldSlot(1), STR_POWER_METER_INT, window, grid.getFieldSlot(1), STR_POWER_METER_INT,
[=]() -> uint8_t { [=]() -> uint8_t {
@@ -196,7 +196,7 @@ void RadioToolsPage::rebuild(FormWindow * window)
txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED); txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED);
} else { } else {
txt->setBackgroundColor(COLOR_THEME_SECONDARY2); txt->setBackgroundColor(COLOR_THEME_SECONDARY2);
txt->setTextFlags(CENTERED); txt->setTextFlags(COLOR_THEME_PRIMARY1 | CENTERED);
} }
txt->invalidate(); txt->invalidate();
}); });
@@ -206,7 +206,7 @@ void RadioToolsPage::rebuild(FormWindow * window)
#if defined(INTERNAL_MODULE_MULTI) #if defined(INTERNAL_MODULE_MULTI)
{ {
auto txt = new StaticText(window, grid.getLabelSlot(), "multi", auto txt = new StaticText(window, grid.getLabelSlot(), "multi",
BUTTON_BACKGROUND, CENTERED); BUTTON_BACKGROUND, COLOR_THEME_PRIMARY1 | CENTERED);
auto b = new TextButton( auto b = new TextButton(
window, grid.getFieldSlot(1), STR_SPECTRUM_ANALYSER_INT, window, grid.getFieldSlot(1), STR_SPECTRUM_ANALYSER_INT,
[=]() -> uint8_t { [=]() -> uint8_t {
@@ -221,7 +221,7 @@ void RadioToolsPage::rebuild(FormWindow * window)
txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED); txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED);
} else { } else {
txt->setBackgroundColor(COLOR_THEME_SECONDARY2); txt->setBackgroundColor(COLOR_THEME_SECONDARY2);
txt->setTextFlags(CENTERED); txt->setTextFlags(COLOR_THEME_PRIMARY1 | CENTERED);
} }
txt->invalidate(); txt->invalidate();
}); });
+3 -3
View File
@@ -43,7 +43,7 @@ void RadioTrainerPage::build(FormWindow * window)
for (uint8_t i=0; i<NUM_STICKS; i++) { for (uint8_t i=0; i<NUM_STICKS; i++) {
uint8_t chan = channelOrder(i+1); uint8_t chan = channelOrder(i+1);
TrainerMix * td = &g_eeGeneral.trainer.mix[chan-1]; TrainerMix * td = &g_eeGeneral.trainer.mix[chan-1];
new StaticText(window, grid.getLabelSlot(), TEXT_AT_INDEX(STR_VSRCRAW, (i + 1))); new StaticText(window, grid.getLabelSlot(), TEXT_AT_INDEX(STR_VSRCRAW, (i + 1)), 0, COLOR_THEME_PRIMARY1);
new Choice(window, grid.getFieldSlot(3,0), STR_TRNMODE, 0, 2, GET_SET_DEFAULT(td->mode)); new Choice(window, grid.getFieldSlot(3,0), STR_TRNMODE, 0, 2, GET_SET_DEFAULT(td->mode));
auto weight = new NumberEdit(window, grid.getFieldSlot(3, 1), -125, 125, GET_SET_DEFAULT(td->studWeight)); auto weight = new NumberEdit(window, grid.getFieldSlot(3, 1), -125, 125, GET_SET_DEFAULT(td->studWeight));
weight->setSuffix("%"); weight->setSuffix("%");
@@ -53,7 +53,7 @@ void RadioTrainerPage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Trainer multiplier // Trainer multiplier
new StaticText(window, grid.getLabelSlot(), STR_MULTIPLIER); new StaticText(window, grid.getLabelSlot(), STR_MULTIPLIER, 0, COLOR_THEME_PRIMARY1);
auto multiplier = new NumberEdit(window, grid.getFieldSlot(3, 0), -10, 40, GET_SET_DEFAULT(g_eeGeneral.PPM_Multiplier)); auto multiplier = new NumberEdit(window, grid.getFieldSlot(3, 0), -10, 40, GET_SET_DEFAULT(g_eeGeneral.PPM_Multiplier));
multiplier->setDisplayHandler([](BitmapBuffer * dc, LcdFlags flags, int32_t value) { multiplier->setDisplayHandler([](BitmapBuffer * dc, LcdFlags flags, int32_t value) {
dc->drawNumber(FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value+10, flags | PREC1, 0); dc->drawNumber(FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value+10, flags | PREC1, 0);
@@ -62,7 +62,7 @@ void RadioTrainerPage::build(FormWindow * window)
grid.nextLine(); grid.nextLine();
// Trainer calibration // Trainer calibration
new StaticText(window, grid.getLabelSlot(), STR_CAL); new StaticText(window, grid.getLabelSlot(), STR_CAL, 0, COLOR_THEME_PRIMARY1);
for (int i = 0; i < NUM_STICKS; i++) { for (int i = 0; i < NUM_STICKS; i++) {
#if defined (PPM_UNIT_PERCENT_PREC1) #if defined (PPM_UNIT_PERCENT_PREC1)
auto calib = new NumberEdit(window, grid.getFieldSlot(4, i), 0 , 0, [=]() { return (ppmInput[i]-g_eeGeneral.trainer.calib[i]) * 2; }, nullptr, 0, LEFT | PREC1); auto calib = new NumberEdit(window, grid.getFieldSlot(4, i), 0 , 0, [=]() { return (ppmInput[i]-g_eeGeneral.trainer.calib[i]) * 2; }, nullptr, 0, LEFT | PREC1);
+27 -27
View File
@@ -91,36 +91,36 @@ class versionDialog: public Dialog
// Module // Module
if (module == INTERNAL_MODULE) if (module == INTERNAL_MODULE)
new StaticText(form, grid->getLineSlot(), STR_INTERNAL_MODULE); new StaticText(form, grid->getLineSlot(), STR_INTERNAL_MODULE, 0, COLOR_THEME_PRIMARY1);
else else
new StaticText(form, grid->getLineSlot(), STR_EXTERNAL_MODULE); new StaticText(form, grid->getLineSlot(), STR_EXTERNAL_MODULE, 0, COLOR_THEME_PRIMARY1);
grid->nextLine(); grid->nextLine();
new StaticText(form, grid->getLabelSlot(true), STR_MODULE); new StaticText(form, grid->getLabelSlot(true), STR_MODULE, 0, COLOR_THEME_PRIMARY1);
if (g_model.moduleData[module].type == MODULE_TYPE_NONE) { if (g_model.moduleData[module].type == MODULE_TYPE_NONE) {
new StaticText(form, grid->getFieldSlot(1, 0), STR_OFF); new StaticText(form, grid->getFieldSlot(1, 0), STR_OFF, 0, COLOR_THEME_PRIMARY1);
} }
#if defined(HARDWARE_EXTERNAL_ACCESS_MOD) #if defined(HARDWARE_EXTERNAL_ACCESS_MOD)
else if (isModuleMultimodule(module)) { else if (isModuleMultimodule(module)) {
char statusText[64]; char statusText[64];
new StaticText(form, grid->getFieldSlot(2, 0), "Multimodule"); new StaticText(form, grid->getFieldSlot(2, 0), "Multimodule", 0, COLOR_THEME_PRIMARY1);
getMultiModuleStatus(module).getStatusString(statusText); getMultiModuleStatus(module).getStatusString(statusText);
new StaticText(form, grid->getFieldSlot(2, 1), statusText); new StaticText(form, grid->getFieldSlot(2, 1), statusText, 0, COLOR_THEME_PRIMARY1);
} }
#endif #endif
else if (!isModulePXX2(module)) { else if (!isModulePXX2(module)) {
new StaticText(form, grid->getFieldSlot(1, 0), STR_NO_INFORMATION); new StaticText(form, grid->getFieldSlot(1, 0), STR_NO_INFORMATION, 0, COLOR_THEME_PRIMARY1);
} }
else { else {
// PXX2 Module // PXX2 Module
new StaticText(form, grid->getFieldSlot(4, 0), getPXX2ModuleName(reusableBuffer.hardwareAndSettings.modules[module].information.modelID)); new StaticText(form, grid->getFieldSlot(4, 0), getPXX2ModuleName(reusableBuffer.hardwareAndSettings.modules[module].information.modelID), 0, COLOR_THEME_PRIMARY1);
if (reusableBuffer.hardwareAndSettings.modules[module].information.modelID) { if (reusableBuffer.hardwareAndSettings.modules[module].information.modelID) {
new StaticText(form, grid->getFieldSlot(4, 1), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].information.hwVersion)); new StaticText(form, grid->getFieldSlot(4, 1), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].information.hwVersion), 0, COLOR_THEME_PRIMARY1);
new StaticText(form, grid->getFieldSlot(4, 2), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].information.swVersion)); new StaticText(form, grid->getFieldSlot(4, 2), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].information.swVersion), 0, COLOR_THEME_PRIMARY1);
static const char * variants[] = {"FCC", "EU", "FLEX"}; static const char * variants[] = {"FCC", "EU", "FLEX"};
uint8_t variant = reusableBuffer.hardwareAndSettings.modules[module].information.variant - 1; uint8_t variant = reusableBuffer.hardwareAndSettings.modules[module].information.variant - 1;
if (variant < DIM(variants)) { if (variant < DIM(variants)) {
new StaticText(form, grid->getFieldSlot(4, 3), variants[variant]); new StaticText(form, grid->getFieldSlot(4, 3), variants[variant], 0, COLOR_THEME_PRIMARY1);
} }
} }
grid->nextLine(); grid->nextLine();
@@ -129,13 +129,13 @@ class versionDialog: public Dialog
for (uint8_t receiver=0; receiver<PXX2_MAX_RECEIVERS_PER_MODULE; receiver++) { for (uint8_t receiver=0; receiver<PXX2_MAX_RECEIVERS_PER_MODULE; receiver++) {
if (reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.modelID) { if (reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.modelID) {
// Receiver model // Receiver model
new StaticText(form, grid->getLabelSlot(true), STR_RECEIVER); new StaticText(form, grid->getLabelSlot(true), STR_RECEIVER, 0, COLOR_THEME_PRIMARY1);
uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.modelID; uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.modelID;
new StaticText(form, grid->getFieldSlot(4, 0), getPXX2ReceiverName(modelId)); new StaticText(form, grid->getFieldSlot(4, 0), getPXX2ReceiverName(modelId), 0, COLOR_THEME_PRIMARY1);
// Receiver version // Receiver version
new StaticText(form, grid->getFieldSlot(4, 1), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.hwVersion)); new StaticText(form, grid->getFieldSlot(4, 1), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.hwVersion), 0, COLOR_THEME_PRIMARY1);
new StaticText(form, grid->getFieldSlot(4, 2), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.swVersion)); new StaticText(form, grid->getFieldSlot(4, 2), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.swVersion), 0, COLOR_THEME_PRIMARY1);
grid->nextLine(); grid->nextLine();
} }
} }
@@ -168,7 +168,7 @@ class versionDialog: public Dialog
class OptionsText: public StaticText { class OptionsText: public StaticText {
public: public:
OptionsText(Window * parent, const rect_t &rect) : OptionsText(Window * parent, const rect_t &rect) :
StaticText(parent, rect) StaticText(parent, rect, "", 0, COLOR_THEME_PRIMARY1)
{ {
coord_t optionWidth = 0; coord_t optionWidth = 0;
for (uint8_t i = 0; options[i]; i++) { for (uint8_t i = 0; options[i]; i++) {
@@ -189,13 +189,13 @@ class OptionsText: public StaticText {
const char * option = options[i]; const char * option = options[i];
coord_t optionWidth = getTextWidth(option); coord_t optionWidth = getTextWidth(option);
if (x + 5 + optionWidth > width()) { if (x + 5 + optionWidth > width()) {
dc->drawText(x, y, ","); dc->drawText(x, y, ",", COLOR_THEME_PRIMARY1);
x = 0; x = 0;
y += FH; y += FH;
} }
if (i > 0 && x != 0) if (i > 0 && x != 0)
x = dc->drawText(x, y, ", "); x = dc->drawText(x, y, ", ", COLOR_THEME_PRIMARY1);
x = dc->drawText(x, y, option); x = dc->drawText(x, y, option, COLOR_THEME_PRIMARY1);
} }
} }
}; };
@@ -212,34 +212,34 @@ void RadioVersionPage::build(FormWindow * window)
grid.spacer(PAGE_PADDING); grid.spacer(PAGE_PADDING);
// Radio type // Radio type
new StaticText(window, grid.getLineSlot(), fw_stamp); new StaticText(window, grid.getLineSlot(), fw_stamp, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
#if LCD_W > LCD_H #if LCD_W > LCD_H
new StaticText(window, grid.getLineSlot(), vers_stamp); new StaticText(window, grid.getLineSlot(), vers_stamp, 0, COLOR_THEME_PRIMARY1);
#else #else
memcpy(reusableBuffer.version.id, vers_stamp, strcspn(vers_stamp, " ")); memcpy(reusableBuffer.version.id, vers_stamp, strcspn(vers_stamp, " "));
new StaticText(window, grid.getFieldSlot(), reusableBuffer.version.id); new StaticText(window, grid.getFieldSlot(), reusableBuffer.version.id, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
strAppend(reusableBuffer.version.id, strpbrk(vers_stamp, " ")); strAppend(reusableBuffer.version.id, strpbrk(vers_stamp, " "));
new StaticText(window, grid.getFieldSlot(), reusableBuffer.version.id); new StaticText(window, grid.getFieldSlot(), reusableBuffer.version.id, 0, COLOR_THEME_PRIMARY1);
#endif #endif
grid.nextLine(); grid.nextLine();
// Firmware date // Firmware date
new StaticText(window, grid.getLineSlot(), date_stamp); new StaticText(window, grid.getLineSlot(), date_stamp, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Firmware time // Firmware time
new StaticText(window, grid.getLineSlot(), time_stamp); new StaticText(window, grid.getLineSlot(), time_stamp, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// EEprom version // EEprom version
new StaticText(window, grid.getLineSlot(), eeprom_stamp); new StaticText(window, grid.getLineSlot(), eeprom_stamp, 0, COLOR_THEME_PRIMARY1);
grid.nextLine(); grid.nextLine();
// Firmware options // Firmware options
new StaticText(window, grid.getLabelSlot(), "OPTS:"); new StaticText(window, grid.getLabelSlot(), "OPTS:", 0, COLOR_THEME_PRIMARY1);
auto options = new OptionsText(window, grid.getFieldSlot(1,0)); auto options = new OptionsText(window, grid.getFieldSlot(1,0));
grid.nextLine(options->height() + 4); grid.nextLine(options->height() + 4);
@@ -330,6 +330,6 @@ void ViewMainDecoration::createFlightMode()
return g_model.flightModeData[mixerCurrentFlightMode].name; return g_model.flightModeData[mixerCurrentFlightMode].name;
}; };
flightMode = new DynamicText(this, r, getFM, CENTERED); flightMode = new DynamicText(this, r, getFM, CENTERED | COLOR_THEME_SECONDARY1);
} }