diff --git a/radio/src/gui/colorlcd/curve.cpp b/radio/src/gui/colorlcd/curve.cpp index ee62a79d0..ce796d63d 100644 --- a/radio/src/gui/colorlcd/curve.cpp +++ b/radio/src/gui/colorlcd/curve.cpp @@ -27,21 +27,20 @@ void Curve::drawBackground(BitmapBuffer * dc) { - lcdSetColor(RGB(0xE0, 0xE0, 0xE0)); - dc->clear(CUSTOM_COLOR); + dc->clear(FIELD_BGCOLOR); // Axis - dc->drawSolidHorizontalLine(0, height()/2, width(), DISABLE_COLOR); - dc->drawSolidVerticalLine(width()/2, 0, height(), DISABLE_COLOR); + dc->drawSolidHorizontalLine(0, height()/2, width(), FIELD_FRAME_COLOR); + dc->drawSolidVerticalLine(width()/2, 0, height(), FIELD_FRAME_COLOR); // Extra lines - dc->drawVerticalLine(width()/4, 0, height(), STASHED, DISABLE_COLOR); - dc->drawVerticalLine(width()*3/4, 0, height(), STASHED, DISABLE_COLOR); - dc->drawHorizontalLine(0, height()/4, width(), STASHED, DISABLE_COLOR); - dc->drawHorizontalLine(0, height()*3/4, width(), STASHED, DISABLE_COLOR); + dc->drawVerticalLine(width()/4, 0, height(), STASHED, FIELD_FRAME_COLOR); + dc->drawVerticalLine(width()*3/4, 0, height(), STASHED, FIELD_FRAME_COLOR); + dc->drawHorizontalLine(0, height()/4, width(), STASHED, FIELD_FRAME_COLOR); + dc->drawHorizontalLine(0, height()*3/4, width(), STASHED, FIELD_FRAME_COLOR); // Outside border - // dc->drawSolidRect(0, 0, width(), height(), 1, DEFAULT_COLOR); + dc->drawSolidRect(0, 0, width(), height(), 1, FIELD_FRAME_COLOR); } coord_t Curve::getPointX(int x) const @@ -89,17 +88,17 @@ void Curve::drawPosition(BitmapBuffer * dc) coord_t y = getPointY(valueY); // the 2 lines - dc->drawSolidHorizontalLine(0, y, width(), CURVE_CURSOR_COLOR); - dc->drawSolidVerticalLine(x, 0, height(), CURVE_CURSOR_COLOR); + dc->drawSolidHorizontalLine(0, y, width(), HIGHLIGHT_COLOR); + dc->drawSolidVerticalLine(x, 0, height(), HIGHLIGHT_COLOR); // the point (white inside) - dc->drawBitmapPattern(x-4, y-4, LBM_CURVE_POINT, CURVE_CURSOR_COLOR); - dc->drawBitmapPattern(x-4, y-4, LBM_CURVE_POINT_CENTER, DEFAULT_BGCOLOR); + dc->drawBitmapPattern(x-4, y-4, LBM_CURVE_POINT, HIGHLIGHT_COLOR); + dc->drawBitmapPattern(x-4, y-4, LBM_CURVE_POINT_CENTER, FOCUS_COLOR); char coords[16]; strAppendSigned(strAppend(strAppendSigned(coords, calcRESXto100(valueX)), ","), calcRESXto100(valueY)); - dc->drawSolidFilledRect(10, 11, 1 + getTextWidth(coords, 0, FONT(XS)), 17, CURVE_CURSOR_COLOR); - dc->drawText(11, 10, coords, FONT(XS)|DEFAULT_BGCOLOR); + dc->drawSolidFilledRect(10, 11, 1 + getTextWidth(coords, 0, FONT(XS)), 17, HIGHLIGHT_COLOR); + dc->drawText(11, 10, coords, FONT(XS) | FOCUS_COLOR); } void Curve::drawPoint(BitmapBuffer * dc, const CurvePoint & point) diff --git a/radio/src/gui/colorlcd/curveedit.cpp b/radio/src/gui/colorlcd/curveedit.cpp index 9eb248083..9de50061f 100644 --- a/radio/src/gui/colorlcd/curveedit.cpp +++ b/radio/src/gui/colorlcd/curveedit.cpp @@ -42,48 +42,73 @@ void CurveDataEdit::update() grid.setMarginRight(parent->width() - rect.w + 5); coord_t boxWidth = rect.w / 5; - coord_t boxHeight = (rect.h - 6) / 3; + coord_t boxHeight = PAGE_LINE_HEIGHT; CurveHeader & curve = g_model.curves[index]; uint8_t curvePointsCount = 5 + curve.points; // Point number for (uint8_t i = 0; i < curvePointsCount; i++) { - new StaticText(this, {i * boxWidth, 10, boxWidth, boxHeight}, std::to_string(i + 1), 0, RIGHT | TEXT_DISABLE_COLOR); + auto txt = new StaticText( + this, + {i * boxWidth + PAGE_PADDING, 10, boxWidth - PAGE_PADDING, boxHeight}, + std::to_string(i + 1) + " ", 0, RIGHT | DEFAULT_COLOR); + txt->setBackgroundColor(FIELD_FRAME_COLOR); } - grid.spacer(rect.h / 3); + grid.spacer(boxHeight + 10 + PAGE_PADDING); // x value if (curve.type == CURVE_TYPE_CUSTOM) { // Adjustable points for custom curves for (uint8_t i = 0; i < curvePointsCount; i++) { - int8_t * points = curveAddress(index); - auto pointEdit = new NumberEdit(this, {coord_t(PAGE_LINE_SPACING + 1 + i * boxWidth), 10 + boxHeight, coord_t(boxWidth - PAGE_LINE_SPACING), boxHeight - 12}, - i <= 1 ? -100 : points[curvePointsCount + i - 2], - i >= curvePointsCount - 2 ? 100 : points[curvePointsCount + i], - GET_VALUE(i == 0 ? -100 : i == curvePointsCount - 1 ? 100 : points[curvePointsCount + i - 1]), - [=](int32_t newValue) { - points[curvePointsCount + i - 1] = newValue; - SET_DIRTY(); - curveEdit->updatePreview(); - }, 0, RIGHT); + int8_t* points = curveAddress(index); + auto pointEdit = new NumberEdit( + this, + {coord_t(PAGE_LINE_SPACING + 1 + i * boxWidth), + grid.getWindowHeight(), coord_t(boxWidth - PAGE_LINE_SPACING), + boxHeight}, + i <= 1 ? -100 : points[curvePointsCount + i - 2], + i >= curvePointsCount - 2 ? 100 : points[curvePointsCount + i], + GET_VALUE(i == 0 ? -100 + : i == curvePointsCount - 1 + ? 100 + : points[curvePointsCount + i - 1]), + [=](int32_t newValue) { + points[curvePointsCount + i - 1] = newValue; + SET_DIRTY(); + curveEdit->updatePreview(); + }, + 0, RIGHT); if (i == 0 || i == curvePointsCount - 1) { pointEdit->disable(); } } - } - else { + } else { for (uint8_t i = 0; i < curvePointsCount; i++) { - new StaticText(this, {i * boxWidth, 10 + boxHeight, boxWidth, boxHeight}, std::to_string(-100 + 200 * i / (5 + curve.points - 1)), 0, RIGHT | TEXT_DISABLE_COLOR); + new StaticText(this, {i * boxWidth, grid.getWindowHeight(), boxWidth, boxHeight}, + std::to_string(-100 + 200 * i / (5 + curve.points - 1)), 0, + RIGHT | DEFAULT_COLOR); } } + grid.spacer(boxHeight + PAGE_PADDING); // y value for (uint8_t i = 0; i < curvePointsCount; i++) { - int8_t * points = curveAddress(index); - new NumberEdit(this, {coord_t(PAGE_LINE_SPACING + 1 + i * boxWidth), 10 + 2 * boxHeight, coord_t(boxWidth - PAGE_LINE_SPACING), boxHeight - 12}, -100, 100, - GET_VALUE(points[i]), [=](int32_t newValue) { points[i] = newValue; SET_DIRTY(); curveEdit->updatePreview(); }, 0, RIGHT); + int8_t* points = curveAddress(index); + new NumberEdit( + this, + {coord_t(PAGE_LINE_SPACING + 1 + i * boxWidth), + grid.getWindowHeight(), + coord_t(boxWidth - PAGE_LINE_SPACING), + boxHeight}, + -100, 100, GET_VALUE(points[i]), + [=](int32_t newValue) { + points[i] = newValue; + SET_DIRTY(); + curveEdit->updatePreview(); + }, + 0, RIGHT); } setInnerWidth(curvePointsCount * boxWidth); @@ -92,8 +117,8 @@ void CurveDataEdit::update() void CurveDataEdit::paint(BitmapBuffer * dc) { dc->clear(DEFAULT_BGCOLOR); - dc->drawSolidHorizontalLine(0, rect.h / 3, getInnerWidth(), 0); - dc->drawSolidHorizontalLine(0, 2 * rect.h / 3, getInnerWidth(), 0); + // dc->drawSolidHorizontalLine(0, rect.h / 3, getInnerWidth(), 0); + // dc->drawSolidHorizontalLine(0, 2 * rect.h / 3, getInnerWidth(), 0); drawHorizontalScrollbar(dc); } @@ -125,35 +150,35 @@ void CurveEdit::updatePreview() invalidate(); } -#if defined(HARDWARE_TOUCH) -bool CurveEdit::onTouchEnd(coord_t x, coord_t y) -{ - if (!hasFocus()) { - setFocus(SET_FOCUS_DEFAULT); - } +// #if defined(HARDWARE_TOUCH) +// bool CurveEdit::onTouchEnd(coord_t x, coord_t y) +// { +// if (!hasFocus()) { +// setFocus(SET_FOCUS_DEFAULT); +// } - CurveKeyboard::show(this, isCustomCurve()); +// CurveKeyboard::show(this, isCustomCurve()); - CurveHeader & curve = g_model.curves[index]; - for (int i=0; i<5 + curve.points; i++) { - if (i != current) { - point_t point = getPoint(index, i); - if (abs(preview.getPointX(point.x) - x) <= 10 && abs(preview.getPointY(point.y) - y) <= 10) { - current = i; - updatePreview(); - break; - } - } - } +// CurveHeader & curve = g_model.curves[index]; +// for (int i=0; i<5 + curve.points; i++) { +// if (i != current) { +// point_t point = getPoint(index, i); +// if (abs(preview.getPointX(point.x) - x) <= 10 && abs(preview.getPointY(point.y) - y) <= 10) { +// current = i; +// updatePreview(); +// break; +// } +// } +// } - return true; -} +// return true; +// } -void CurveEdit::onFocusLost() -{ - CurveKeyboard::hide(); -} -#endif +// void CurveEdit::onFocusLost() +// { +// CurveKeyboard::hide(); +// } +// #endif void CurveEdit::next() { diff --git a/radio/src/gui/colorlcd/curveedit.h b/radio/src/gui/colorlcd/curveedit.h index 11efa8f8a..d76de9553 100644 --- a/radio/src/gui/colorlcd/curveedit.h +++ b/radio/src/gui/colorlcd/curveedit.h @@ -62,11 +62,10 @@ class CurveEdit: public FormField void onEvent(event_t event) override; -#if defined(HARDWARE_TOUCH) - bool onTouchEnd(coord_t x, coord_t y) override; - - void onFocusLost() override; -#endif +// #if defined(HARDWARE_TOUCH) +// bool onTouchEnd(coord_t x, coord_t y) override; +// void onFocusLost() override; +// #endif protected: Curve preview; diff --git a/radio/src/gui/colorlcd/model_inputs.cpp b/radio/src/gui/colorlcd/model_inputs.cpp index 14f8d1cbc..815d709e6 100644 --- a/radio/src/gui/colorlcd/model_inputs.cpp +++ b/radio/src/gui/colorlcd/model_inputs.cpp @@ -91,101 +91,104 @@ void deleteExpo(uint8_t idx) storageDirty(EE_MODEL); } -class InputEditWindow: public Page +class InputEditWindow : public Page { - public: - InputEditWindow(int8_t input, uint8_t index): + public: + InputEditWindow(int8_t input, uint8_t index) : Page(ICON_MODEL_INPUTS), input(input), index(index), - preview(this, {INPUT_EDIT_CURVE_LEFT, INPUT_EDIT_CURVE_TOP, INPUT_EDIT_CURVE_WIDTH, INPUT_EDIT_CURVE_HEIGHT}, - [=](int x) -> int { - ExpoData * line = expoAddress(index); - int16_t anas[MAX_INPUTS] = {0}; - applyExpos(anas, e_perout_mode_inactive_flight_mode, line->srcRaw, x); - return anas[line->chn]; - }, - [=]() -> int { - return getValue(expoAddress(index)->srcRaw); - }) - { + preview( + this, + {INPUT_EDIT_CURVE_LEFT, INPUT_EDIT_CURVE_TOP, INPUT_EDIT_CURVE_WIDTH, + INPUT_EDIT_CURVE_HEIGHT}, + [=](int x) -> int { + ExpoData *line = expoAddress(index); + int16_t anas[MAX_INPUTS] = {0}; + applyExpos(anas, e_perout_mode_inactive_flight_mode, line->srcRaw, + x); + return anas[line->chn]; + }, + [=]() -> int { return getValue(expoAddress(index)->srcRaw); }) + { #if LCD_W > LCD_H - body.setWidth(LCD_W - 170); + body.setWidth(LCD_W - preview.width() - PAGE_PADDING); + body.setLeft(preview.width() + PAGE_PADDING); #else - body.setRect({0, INPUT_EDIT_CURVE_TOP + INPUT_EDIT_CURVE_HEIGHT, LCD_W, LCD_H - INPUT_EDIT_CURVE_TOP - INPUT_EDIT_CURVE_HEIGHT}); + body.setRect({0, INPUT_EDIT_CURVE_TOP + INPUT_EDIT_CURVE_HEIGHT, LCD_W, + LCD_H - INPUT_EDIT_CURVE_TOP - INPUT_EDIT_CURVE_HEIGHT}); #endif - buildBody(&body); - buildHeader(&header); - } + buildBody(&body); + buildHeader(&header); + } - void deleteLater(bool detach = true, bool trash = true) override - { - if (_deleted) - return; + void deleteLater(bool detach = true, bool trash = true) override + { + if (_deleted) return; - preview.deleteLater(true, false); + preview.deleteLater(true, false); - Page::deleteLater(detach, trash); - } + Page::deleteLater(detach, trash); + } - protected: - uint8_t input; - uint8_t index; - Curve preview; - Choice * trimChoice = nullptr; - FormGroup * curveParamField = nullptr; + protected: + uint8_t input; + uint8_t index; + Curve preview; + Choice *trimChoice = nullptr; + FormGroup *curveParamField = nullptr; - void buildHeader(Window * window) - { - new StaticText(window, - {PAGE_TITLE_LEFT, PAGE_TITLE_TOP, LCD_W - PAGE_TITLE_LEFT, - PAGE_LINE_HEIGHT}, - STR_MENUINPUTS, 0,FOCUS_COLOR); - new StaticText(window, - {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, - LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, - getSourceString(MIXSRC_FIRST_INPUT + input), 0, - FOCUS_COLOR); - } + void buildHeader(Window *window) + { + new StaticText(window, + {PAGE_TITLE_LEFT, PAGE_TITLE_TOP, LCD_W - PAGE_TITLE_LEFT, + PAGE_LINE_HEIGHT}, + STR_MENUINPUTS, 0, FOCUS_COLOR); + new StaticText(window, + {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, + LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, + getSourceString(MIXSRC_FIRST_INPUT + input), 0, FOCUS_COLOR); + } - // TODO share this code with MIXER - void updateCurveParamField(ExpoData * line) - { - curveParamField->clear(); + // TODO share this code with MIXER + void updateCurveParamField(ExpoData *line) + { + curveParamField->clear(); - const rect_t rect = {0, 0, curveParamField->width(), curveParamField->height()}; + const rect_t rect = {0, 0, curveParamField->width(), + curveParamField->height()}; - switch (line->curve.type) { - case CURVE_REF_DIFF: - case CURVE_REF_EXPO: - { - GVarNumberEdit * edit = new GVarNumberEdit(curveParamField, rect, -100, 100, GET_SET_DEFAULT(line->curve.value)); - edit->setSuffix("%"); - break; - } + switch (line->curve.type) { + case CURVE_REF_DIFF: + case CURVE_REF_EXPO: { + GVarNumberEdit *edit = + new GVarNumberEdit(curveParamField, rect, -100, 100, + GET_SET_DEFAULT(line->curve.value)); + edit->setSuffix("%"); + break; + } - case CURVE_REF_FUNC: - new Choice(curveParamField, rect, STR_VCURVEFUNC, 0, CURVE_BASE - 1, GET_SET_DEFAULT(line->curve.value)); - break; + case CURVE_REF_FUNC: + new Choice(curveParamField, rect, STR_VCURVEFUNC, 0, CURVE_BASE - 1, + GET_SET_DEFAULT(line->curve.value)); + break; - case CURVE_REF_CUSTOM: - { - auto choice = new Choice(curveParamField, rect, -MAX_CURVES, MAX_CURVES, GET_SET_DEFAULT(line->curve.value)); - choice->setTextHandler([](int value) { - return getCurveString(value); - }); - break; - } + case CURVE_REF_CUSTOM: { + auto choice = new Choice(curveParamField, rect, -MAX_CURVES, MAX_CURVES, + GET_SET_DEFAULT(line->curve.value)); + choice->setTextHandler([](int value) { return getCurveString(value); }); + break; } } + } - void buildBody(FormWindow * window) - { - FormGridLayout grid; - grid.setLabelWidth(INPUT_EDIT_LABELS_WIDTH); - grid.spacer(PAGE_PADDING); + void buildBody(FormWindow *window) + { + FormGridLayout grid; + grid.setLabelWidth(INPUT_EDIT_LABELS_WIDTH); + grid.spacer(PAGE_PADDING); - ExpoData * line = expoAddress(index) ; + ExpoData *line = expoAddress(index); #if LCD_W > LCD_H grid.setMarginRight(180); @@ -495,6 +498,7 @@ void ModelInputsPage::build(FormWindow *window, int8_t focusIndex) txt->setTextFlags(CENTERED); } txt->invalidate(); + if (focus) button->bringToTop(); }); if (focusIndex == inputIndex) { diff --git a/radio/src/gui/colorlcd/model_mixes.cpp b/radio/src/gui/colorlcd/model_mixes.cpp index 5ac524630..7088fb649 100644 --- a/radio/src/gui/colorlcd/model_mixes.cpp +++ b/radio/src/gui/colorlcd/model_mixes.cpp @@ -331,6 +331,21 @@ void ModelMixesPage::editMix(FormWindow * window, uint8_t channel, uint8_t mixIn }); } +class MixLineTitle : public StaticText +{ + public: + using StaticText::StaticText; + + void setTextFlags(LcdFlags flags) + { + textFlags = flags; + for (auto child : children) { + auto bitmap = dynamic_cast(child); + if (bitmap) bitmap->setMaskColor(flags & 0xFFFF0000); + } + } +}; + void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex) { FormGridLayout grid; @@ -349,9 +364,9 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex) if (mixIndex < MAX_MIXERS && mix->srcRaw > 0 && mix->destCh == ch) { coord_t h = grid.getWindowHeight(); - auto txt = new StaticText(window, grid.getLabelSlot(), - getSourceString(MIXSRC_CH1 + ch), - BUTTON_BACKGROUND, CENTERED); + auto txt = new MixLineTitle(window, grid.getLabelSlot(), + getSourceString(MIXSRC_CH1 + ch), + BUTTON_BACKGROUND, CENTERED); uint8_t count = 0; while (mixIndex < MAX_MIXERS && mix->srcRaw > 0 && mix->destCh == ch) { @@ -408,7 +423,10 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex) StaticBitmap* bitmap = nullptr; if (count++ > 0) { bitmap = new StaticBitmap( - window, {35, button->top() + (button->height() - 18) / 2, 25, 17}, + txt, + {35 - txt->left(), + button->top() - txt->top() + (button->height() - 18) / 2, 25, + 17}, mixerMultiplexBitmap[mix->mltpx], DEFAULT_COLOR); } @@ -416,14 +434,12 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex) if (focus) { txt->setBackgroundColor(FOCUS_BGCOLOR); txt->setTextFlags(FOCUS_COLOR | CENTERED); - if (bitmap) bitmap->setMaskColor(FOCUS_COLOR); } else { txt->setBackgroundColor(FIELD_FRAME_COLOR); txt->setTextFlags(CENTERED); - if (bitmap) bitmap->setMaskColor(DEFAULT_COLOR); } txt->invalidate(); - if (bitmap) bitmap->invalidate(); + if (focus) button->bringToTop(); }); if (focusMixIndex == mixIndex) { @@ -431,10 +447,6 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex) txt->setBackgroundColor(FOCUS_BGCOLOR); txt->setTextFlags(FOCUS_COLOR | CENTERED); txt->invalidate(); - if (bitmap) { - bitmap->setMaskColor(FOCUS_COLOR); - bitmap->invalidate(); - } } diff --git a/radio/src/gui/colorlcd/model_setup.cpp b/radio/src/gui/colorlcd/model_setup.cpp index 208633f2c..8fe79bede 100644 --- a/radio/src/gui/colorlcd/model_setup.cpp +++ b/radio/src/gui/colorlcd/model_setup.cpp @@ -34,7 +34,11 @@ std::string switchWarninglabel(swsrc_t index) CHAR_DOWN }; - return TEXT_AT_INDEX(STR_VSRCRAW, (index + MIXSRC_FIRST_SWITCH - MIXSRC_Rud + 1)) + std::string(&switchPositions[g_model.switchWarningState >> (3*index) & 0x07], 1); + return TEXT_AT_INDEX(STR_VSRCRAW, + (index + MIXSRC_FIRST_SWITCH - MIXSRC_Rud + 1)) + + std::string( + &switchPositions[g_model.switchWarningState >> (3 * index) & 0x07], + 1); } class ChannelFailsafeBargraph: public Window { diff --git a/radio/src/gui/colorlcd/sourcechoice.cpp b/radio/src/gui/colorlcd/sourcechoice.cpp index f0d1f0e57..68efe32d8 100644 --- a/radio/src/gui/colorlcd/sourcechoice.cpp +++ b/radio/src/gui/colorlcd/sourcechoice.cpp @@ -71,6 +71,8 @@ void SourceChoice::paint(BitmapBuffer * dc) textColor = 0; drawSource(dc, FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value, textColor); + dc->drawBitmapPattern(rect.w - 20, (rect.h - 11) / 2, LBM_DROPDOWN, + textColor); } // defined in gui/gui_common.cpp diff --git a/radio/src/gui/colorlcd/switchchoice.cpp b/radio/src/gui/colorlcd/switchchoice.cpp index 65292f43e..9db366569 100644 --- a/radio/src/gui/colorlcd/switchchoice.cpp +++ b/radio/src/gui/colorlcd/switchchoice.cpp @@ -55,6 +55,8 @@ void SwitchChoice::paint(BitmapBuffer * dc) textColor = DEFAULT_COLOR; drawSwitch(dc, FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value, textColor); + dc->drawBitmapPattern(rect.w - 20, (rect.h - 11) / 2, LBM_DROPDOWN, + textColor); } void SwitchChoice::fillMenu(Menu * menu, std::function filter) diff --git a/radio/src/gui/colorlcd/theme.h b/radio/src/gui/colorlcd/theme.h index 34b41e7be..9645a3084 100644 --- a/radio/src/gui/colorlcd/theme.h +++ b/radio/src/gui/colorlcd/theme.h @@ -124,4 +124,6 @@ void loadTheme(); std::list & getRegisteredThemes(); +extern const uint8_t LBM_DROPDOWN[]; + #endif // _COLORLCD_THEME_H_ diff --git a/radio/src/gui/colorlcd/view_channels.cpp b/radio/src/gui/colorlcd/view_channels.cpp index ab55fc170..8bfd1905a 100644 --- a/radio/src/gui/colorlcd/view_channels.cpp +++ b/radio/src/gui/colorlcd/view_channels.cpp @@ -46,9 +46,9 @@ class ChannelsViewFooter: public Window { // Draw single legend coord_t drawChannelsMonitorLegend(BitmapBuffer * dc, coord_t x, const char * s, int color) { - dc->drawSolidFilledRect(x, 2, LEG_COLORBOX + 2, LEG_COLORBOX + 2, BARGRAPH_BGCOLOR); - dc->drawSolidFilledRect(x + 1, 3, LEG_COLORBOX, LEG_COLORBOX, color); - dc->drawText(x + 20, 2, s, TEXT_STATUSBAR_COLOR); + dc->drawSolidFilledRect(x, 4, LEG_COLORBOX + 2, LEG_COLORBOX + 2, BARGRAPH_BGCOLOR); + dc->drawSolidFilledRect(x + 1, 5, LEG_COLORBOX, LEG_COLORBOX, color); + dc->drawText(x + 20, 4, s, TEXT_STATUSBAR_COLOR); return x + 25 + getTextWidth(s); } diff --git a/radio/src/targets/horus/libopenui_config.h b/radio/src/targets/horus/libopenui_config.h index 87c7e8f23..2e89621f3 100644 --- a/radio/src/targets/horus/libopenui_config.h +++ b/radio/src/targets/horus/libopenui_config.h @@ -106,9 +106,9 @@ constexpr uint32_t PAGE_TITLE_LEFT = 50; constexpr uint32_t INPUT_EDIT_LABELS_WIDTH = 120; constexpr coord_t INPUT_EDIT_CURVE_WIDTH = 158; -constexpr coord_t INPUT_EDIT_CURVE_HEIGHT = LCD_H - MENU_HEADER_HEIGHT; -constexpr coord_t INPUT_EDIT_CURVE_LEFT = LCD_W - 158; -constexpr coord_t INPUT_EDIT_CURVE_TOP = MENU_HEADER_HEIGHT; +constexpr coord_t INPUT_EDIT_CURVE_HEIGHT = INPUT_EDIT_CURVE_WIDTH; +constexpr coord_t INPUT_EDIT_CURVE_LEFT = PAGE_PADDING; +constexpr coord_t INPUT_EDIT_CURVE_TOP = MENU_HEADER_HEIGHT + PAGE_PADDING; constexpr coord_t MENUS_LINE_HEIGHT = 30; constexpr coord_t MENUS_WIDTH = 200; constexpr coord_t MENUS_OFFSET_TOP = 20; diff --git a/radio/src/thirdparty/libopenui b/radio/src/thirdparty/libopenui index 2ef946f14..6b661c490 160000 --- a/radio/src/thirdparty/libopenui +++ b/radio/src/thirdparty/libopenui @@ -1 +1 @@ -Subproject commit 2ef946f14768a23143c59a1ba578e69349b4dacb +Subproject commit 6b661c4907bcafc08436e5c96fc5a38e9eb6e499