diff --git a/radio/src/gui/colorlcd/widgets/outputs.cpp b/radio/src/gui/colorlcd/widgets/outputs.cpp index 98627c080..aa3417d91 100644 --- a/radio/src/gui/colorlcd/widgets/outputs.cpp +++ b/radio/src/gui/colorlcd/widgets/outputs.cpp @@ -182,11 +182,11 @@ class OutputsWidget : public Widget { auto widgetData = getPersistentData(); - // get background color from options[2] - etx_bg_color_from_flags(lvobj, widgetData->options[2].value.unsignedValue); + // get background color from options[3] + etx_bg_color_from_flags(lvobj, widgetData->options[3].value.unsignedValue); - // Set background opacity from options[1] - if (widgetData->options[1].value.boolValue) + // Set background opacity from options[2] + if (widgetData->options[2].value.boolValue) lv_obj_add_state(lvobj, ETX_STATE_BG_FILL); else lv_obj_clear_state(lvobj, ETX_STATE_BG_FILL); @@ -197,14 +197,16 @@ class OutputsWidget : public Widget bool changed = false; // Colors - LcdFlags f = widgetData->options[3].value.unsignedValue; + LcdFlags f = widgetData->options[4].value.unsignedValue; if (f != txtColor) { txtColor = f; changed = true; } - f = widgetData->options[4].value.unsignedValue; + f = widgetData->options[5].value.unsignedValue; if (f != barColor) { barColor = f; changed = true; } // Setup channels uint8_t chan = widgetData->options[0].value.unsignedValue; - if (chan != firstChan) { firstChan= chan; changed = true; } + if (chan != firstChan) { firstChan = chan; changed = true; } + chan = widgetData->options[1].value.unsignedValue; + if (chan != lastChan) { lastChan = chan; changed = true; } // Get size if (width() != lastWidth) { lastWidth = width(); changed = true; } @@ -218,8 +220,8 @@ class OutputsWidget : public Widget clear(); coord_t colWidth = lastWidth / cols; uint8_t chan = firstChan; - for (uint8_t c = 0; c < cols && chan <= MAX_OUTPUT_CHANNELS; c += 1) { - for (uint8_t r = 0; r < rows && chan <= MAX_OUTPUT_CHANNELS; + for (uint8_t c = 0; c < cols && chan <= lastChan; c += 1) { + for (uint8_t r = 0; r < rows && chan <= lastChan; r += 1, chan += 1) { new ChannelValue(this, c, r, colWidth, chan - 1, txtColor, barColor); } @@ -238,6 +240,7 @@ class OutputsWidget : public Widget coord_t lastWidth = -1; coord_t lastHeight = -1; uint8_t firstChan = 255; + uint8_t lastChan = 255; uint8_t cols = 0; uint8_t rows = 0; LcdFlags txtColor = 0; @@ -250,7 +253,8 @@ class OutputsWidget : public Widget }; const WidgetOption OutputsWidget::options[] = { - {STR_FIRST_CHANNEL, WidgetOption::Integer, {1}, {1}, {32}}, + {STR_FIRST_CHANNEL, WidgetOption::Integer, {1}, {1}, {MAX_OUTPUT_CHANNELS}}, + {STR_LAST_CHANNEL, WidgetOption::Integer, {MAX_OUTPUT_CHANNELS}, {1}, {MAX_OUTPUT_CHANNELS}}, {STR_FILL_BACKGROUND, WidgetOption::Bool, false}, {STR_BG_COLOR, WidgetOption::Color, COLOR2FLAGS(COLOR_THEME_SECONDARY3_INDEX)}, {STR_TEXT_COLOR, WidgetOption::Color, COLOR2FLAGS(COLOR_THEME_PRIMARY1_INDEX)}, diff --git a/radio/src/translations/i18n/cn.h b/radio/src/translations/i18n/cn.h index 65f106064..6d7d9c47e 100644 --- a/radio/src/translations/i18n/cn.h +++ b/radio/src/translations/i18n/cn.h @@ -1135,6 +1135,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "起始通道" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "是否填充背景?" #define TR_BG_COLOR "背景颜色" #define TR_SLIDERS_TRIMS "滑块和微调" diff --git a/radio/src/translations/i18n/cz.h b/radio/src/translations/i18n/cz.h index f9f43d8fa..6e5f057c5 100644 --- a/radio/src/translations/i18n/cz.h +++ b/radio/src/translations/i18n/cz.h @@ -1138,6 +1138,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "První kanál" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Vyplnit pozadí?" #define TR_BG_COLOR "Barva pozadí" #define TR_SLIDERS_TRIMS "Slidery+Trimy" diff --git a/radio/src/translations/i18n/da.h b/radio/src/translations/i18n/da.h index 02d999bb0..d279b11e3 100644 --- a/radio/src/translations/i18n/da.h +++ b/radio/src/translations/i18n/da.h @@ -1140,6 +1140,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Første kanal" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Udfyld baggrund?" #define TR_BG_COLOR "BG farve" #define TR_SLIDERS_TRIMS "Skyder+Trim" diff --git a/radio/src/translations/i18n/de.h b/radio/src/translations/i18n/de.h index 4269701b2..b758737eb 100644 --- a/radio/src/translations/i18n/de.h +++ b/radio/src/translations/i18n/de.h @@ -1125,6 +1125,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Erster Kanal" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Hintergrund füllen?" #define TR_BG_COLOR "Hintergrundfarbe" #define TR_SLIDERS_TRIMS "Schieber+Trim" diff --git a/radio/src/translations/i18n/en.h b/radio/src/translations/i18n/en.h index 5147b5b09..f7a28fa3b 100644 --- a/radio/src/translations/i18n/en.h +++ b/radio/src/translations/i18n/en.h @@ -1136,6 +1136,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "First channel" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Fill background?" #define TR_BG_COLOR "BG Color" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/es.h b/radio/src/translations/i18n/es.h index cab24542b..fb3408ea9 100644 --- a/radio/src/translations/i18n/es.h +++ b/radio/src/translations/i18n/es.h @@ -1136,6 +1136,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Primer canal" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Rellenar fondo" #define TR_BG_COLOR "Color BG" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/fi.h b/radio/src/translations/i18n/fi.h index 97ff37eaa..cbd2e4fb7 100644 --- a/radio/src/translations/i18n/fi.h +++ b/radio/src/translations/i18n/fi.h @@ -1135,6 +1135,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "First channel" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Fill background?" #define TR_BG_COLOR "BG Color" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/fr.h b/radio/src/translations/i18n/fr.h index 505e42deb..ddb6e7256 100644 --- a/radio/src/translations/i18n/fr.h +++ b/radio/src/translations/i18n/fr.h @@ -1138,6 +1138,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Premier Canal" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Remplir arrière-plan?" #define TR_BG_COLOR "BG Color" #define TR_SLIDERS_TRIMS "Curseurs+Trims" diff --git a/radio/src/translations/i18n/he.h b/radio/src/translations/i18n/he.h index 5d4316f4d..bb89b3de9 100644 --- a/radio/src/translations/i18n/he.h +++ b/radio/src/translations/i18n/he.h @@ -1138,6 +1138,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "ערוץ ראשון" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "מילוי רקע?" #define TR_BG_COLOR "BG צבעי" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/it.h b/radio/src/translations/i18n/it.h index 61e2e53a5..d27f93bba 100644 --- a/radio/src/translations/i18n/it.h +++ b/radio/src/translations/i18n/it.h @@ -1135,6 +1135,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Primo canale" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Riempi lo sfondo?" #define TR_BG_COLOR "Colore sfondo" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/jp.h b/radio/src/translations/i18n/jp.h index 046a54c37..c49c9b210 100644 --- a/radio/src/translations/i18n/jp.h +++ b/radio/src/translations/i18n/jp.h @@ -1134,6 +1134,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "第1チャンネル" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "背景を塗り潰しますか?" #define TR_BG_COLOR "背景カラー" #define TR_SLIDERS_TRIMS "スライダー+トリム" diff --git a/radio/src/translations/i18n/ko.h b/radio/src/translations/i18n/ko.h index a43b40830..314d7acb6 100644 --- a/radio/src/translations/i18n/ko.h +++ b/radio/src/translations/i18n/ko.h @@ -1186,6 +1186,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "첫 번째 채널" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "배경 채우기?" #define TR_BG_COLOR "배경 색상" #define TR_SLIDERS_TRIMS "슬라이더 + 트림" diff --git a/radio/src/translations/i18n/nl.h b/radio/src/translations/i18n/nl.h index be767ba75..ba3fd08cb 100644 --- a/radio/src/translations/i18n/nl.h +++ b/radio/src/translations/i18n/nl.h @@ -1136,6 +1136,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "First channel" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Fill background?" #define TR_BG_COLOR "BG Color" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/pl.h b/radio/src/translations/i18n/pl.h index 2a9817b48..23a25b3f8 100644 --- a/radio/src/translations/i18n/pl.h +++ b/radio/src/translations/i18n/pl.h @@ -1133,6 +1133,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Pierwszy kanał" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Wypełnić tło?" #define TR_BG_COLOR "BG Color" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/pt.h b/radio/src/translations/i18n/pt.h index 03b35b741..90cd631e0 100644 --- a/radio/src/translations/i18n/pt.h +++ b/radio/src/translations/i18n/pt.h @@ -1136,6 +1136,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "First channel" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Fill background?" #define TR_BG_COLOR "BG Color" #define TR_SLIDERS_TRIMS "Sliders+Trims" diff --git a/radio/src/translations/i18n/ru.h b/radio/src/translations/i18n/ru.h index 5bb7fd742..a127e736e 100644 --- a/radio/src/translations/i18n/ru.h +++ b/radio/src/translations/i18n/ru.h @@ -1137,6 +1137,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Первый канал" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Заполнить фон?" #define TR_BG_COLOR "Цвет фона" #define TR_SLIDERS_TRIMS "Тумблеры+Трим" diff --git a/radio/src/translations/i18n/se.h b/radio/src/translations/i18n/se.h index adc2f895c..8566030bd 100644 --- a/radio/src/translations/i18n/se.h +++ b/radio/src/translations/i18n/se.h @@ -1146,6 +1146,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Första kanal" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Fyll bakgrund?" #define TR_BG_COLOR "Bakgrundsfärg" #define TR_SLIDERS_TRIMS "Reglage+Trimmar" diff --git a/radio/src/translations/i18n/tw.h b/radio/src/translations/i18n/tw.h index dabfbccd3..17f72aa32 100644 --- a/radio/src/translations/i18n/tw.h +++ b/radio/src/translations/i18n/tw.h @@ -1133,6 +1133,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "起始通道" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "是否填充背景?" #define TR_BG_COLOR "背景顏色" #define TR_SLIDERS_TRIMS "滑塊和微調" diff --git a/radio/src/translations/i18n/ua.h b/radio/src/translations/i18n/ua.h index 50243222a..9e75e6e7e 100644 --- a/radio/src/translations/i18n/ua.h +++ b/radio/src/translations/i18n/ua.h @@ -1136,6 +1136,7 @@ // Horus layouts and widgets #define TR_FIRST_CHANNEL "Перший канал" +#define TR_LAST_CHANNEL "Last channel" #define TR_FILL_BACKGROUND "Заповнити фон?" #define TR_BG_COLOR "Колір фону" #define TR_SLIDERS_TRIMS "Повзунки+трими" diff --git a/radio/src/translations/sim_string_list.h b/radio/src/translations/sim_string_list.h index 16c05abda..28afe67d5 100644 --- a/radio/src/translations/sim_string_list.h +++ b/radio/src/translations/sim_string_list.h @@ -76,6 +76,7 @@ #define STR_FILE_SIZE currentLangStrings->STR_FILE_SIZE #define STR_FILL_BACKGROUND currentLangStrings->STR_FILL_BACKGROUND #define STR_FIRST_CHANNEL currentLangStrings->STR_FIRST_CHANNEL +#define STR_LAST_CHANNEL currentLangStrings->STR_LAST_CHANNEL #define STR_FIXED currentLangStrings->STR_FIXED #define STR_FLASH_DEVICE currentLangStrings->STR_FLASH_DEVICE #define STR_FLIGHT_MODE currentLangStrings->STR_FLIGHT_MODE diff --git a/radio/src/translations/string_list.h b/radio/src/translations/string_list.h index ac04fc90a..b84e43a48 100644 --- a/radio/src/translations/string_list.h +++ b/radio/src/translations/string_list.h @@ -75,6 +75,7 @@ STR(FILE_OPEN) STR(FILE_SIZE) STR(FILL_BACKGROUND) STR(FIRST_CHANNEL) +STR(LAST_CHANNEL) STR(FIXED) STR(FLASH_DEVICE) STR(FLIGHT_MODE)