Last round fixes

This commit is contained in:
Raphael Coeffic
2021-06-14 13:48:48 +02:00
parent a535bfea18
commit 13de840ee0
12 changed files with 208 additions and 159 deletions
+14 -15
View File
@@ -27,21 +27,20 @@
void Curve::drawBackground(BitmapBuffer * dc) void Curve::drawBackground(BitmapBuffer * dc)
{ {
lcdSetColor(RGB(0xE0, 0xE0, 0xE0)); dc->clear(FIELD_BGCOLOR);
dc->clear(CUSTOM_COLOR);
// Axis // Axis
dc->drawSolidHorizontalLine(0, height()/2, width(), DISABLE_COLOR); dc->drawSolidHorizontalLine(0, height()/2, width(), FIELD_FRAME_COLOR);
dc->drawSolidVerticalLine(width()/2, 0, height(), DISABLE_COLOR); dc->drawSolidVerticalLine(width()/2, 0, height(), FIELD_FRAME_COLOR);
// Extra lines // Extra lines
dc->drawVerticalLine(width()/4, 0, height(), STASHED, DISABLE_COLOR); dc->drawVerticalLine(width()/4, 0, height(), STASHED, FIELD_FRAME_COLOR);
dc->drawVerticalLine(width()*3/4, 0, height(), STASHED, DISABLE_COLOR); dc->drawVerticalLine(width()*3/4, 0, height(), STASHED, FIELD_FRAME_COLOR);
dc->drawHorizontalLine(0, height()/4, width(), STASHED, DISABLE_COLOR); dc->drawHorizontalLine(0, height()/4, width(), STASHED, FIELD_FRAME_COLOR);
dc->drawHorizontalLine(0, height()*3/4, width(), STASHED, DISABLE_COLOR); dc->drawHorizontalLine(0, height()*3/4, width(), STASHED, FIELD_FRAME_COLOR);
// Outside border // 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 coord_t Curve::getPointX(int x) const
@@ -89,17 +88,17 @@ void Curve::drawPosition(BitmapBuffer * dc)
coord_t y = getPointY(valueY); coord_t y = getPointY(valueY);
// the 2 lines // the 2 lines
dc->drawSolidHorizontalLine(0, y, width(), CURVE_CURSOR_COLOR); dc->drawSolidHorizontalLine(0, y, width(), HIGHLIGHT_COLOR);
dc->drawSolidVerticalLine(x, 0, height(), CURVE_CURSOR_COLOR); dc->drawSolidVerticalLine(x, 0, height(), HIGHLIGHT_COLOR);
// the point (white inside) // 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, HIGHLIGHT_COLOR);
dc->drawBitmapPattern(x-4, y-4, LBM_CURVE_POINT_CENTER, DEFAULT_BGCOLOR); dc->drawBitmapPattern(x-4, y-4, LBM_CURVE_POINT_CENTER, FOCUS_COLOR);
char coords[16]; char coords[16];
strAppendSigned(strAppend(strAppendSigned(coords, calcRESXto100(valueX)), ","), calcRESXto100(valueY)); strAppendSigned(strAppend(strAppendSigned(coords, calcRESXto100(valueX)), ","), calcRESXto100(valueY));
dc->drawSolidFilledRect(10, 11, 1 + getTextWidth(coords, 0, FONT(XS)), 17, CURVE_CURSOR_COLOR); dc->drawSolidFilledRect(10, 11, 1 + getTextWidth(coords, 0, FONT(XS)), 17, HIGHLIGHT_COLOR);
dc->drawText(11, 10, coords, FONT(XS)|DEFAULT_BGCOLOR); dc->drawText(11, 10, coords, FONT(XS) | FOCUS_COLOR);
} }
void Curve::drawPoint(BitmapBuffer * dc, const CurvePoint & point) void Curve::drawPoint(BitmapBuffer * dc, const CurvePoint & point)
+71 -46
View File
@@ -42,48 +42,73 @@ void CurveDataEdit::update()
grid.setMarginRight(parent->width() - rect.w + 5); grid.setMarginRight(parent->width() - rect.w + 5);
coord_t boxWidth = 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]; CurveHeader & curve = g_model.curves[index];
uint8_t curvePointsCount = 5 + curve.points; uint8_t curvePointsCount = 5 + curve.points;
// Point number // Point number
for (uint8_t i = 0; i < curvePointsCount; i++) { 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 // x value
if (curve.type == CURVE_TYPE_CUSTOM) { if (curve.type == CURVE_TYPE_CUSTOM) {
// Adjustable points for custom curves // Adjustable points for custom curves
for (uint8_t i = 0; i < curvePointsCount; i++) { for (uint8_t i = 0; i < curvePointsCount; i++) {
int8_t * points = curveAddress(index); 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}, auto pointEdit = new NumberEdit(
i <= 1 ? -100 : points[curvePointsCount + i - 2], this,
i >= curvePointsCount - 2 ? 100 : points[curvePointsCount + i], {coord_t(PAGE_LINE_SPACING + 1 + i * boxWidth),
GET_VALUE(i == 0 ? -100 : i == curvePointsCount - 1 ? 100 : points[curvePointsCount + i - 1]), grid.getWindowHeight(), coord_t(boxWidth - PAGE_LINE_SPACING),
[=](int32_t newValue) { boxHeight},
points[curvePointsCount + i - 1] = newValue; i <= 1 ? -100 : points[curvePointsCount + i - 2],
SET_DIRTY(); i >= curvePointsCount - 2 ? 100 : points[curvePointsCount + i],
curveEdit->updatePreview(); GET_VALUE(i == 0 ? -100
}, 0, RIGHT); : 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) { if (i == 0 || i == curvePointsCount - 1) {
pointEdit->disable(); pointEdit->disable();
} }
} }
} } else {
else {
for (uint8_t i = 0; i < curvePointsCount; i++) { 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 // y value
for (uint8_t i = 0; i < curvePointsCount; i++) { for (uint8_t i = 0; i < curvePointsCount; i++) {
int8_t * points = curveAddress(index); 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, new NumberEdit(
GET_VALUE(points[i]), [=](int32_t newValue) { points[i] = newValue; SET_DIRTY(); curveEdit->updatePreview(); }, 0, RIGHT); 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); setInnerWidth(curvePointsCount * boxWidth);
@@ -92,8 +117,8 @@ void CurveDataEdit::update()
void CurveDataEdit::paint(BitmapBuffer * dc) void CurveDataEdit::paint(BitmapBuffer * dc)
{ {
dc->clear(DEFAULT_BGCOLOR); dc->clear(DEFAULT_BGCOLOR);
dc->drawSolidHorizontalLine(0, rect.h / 3, getInnerWidth(), 0); // dc->drawSolidHorizontalLine(0, rect.h / 3, getInnerWidth(), 0);
dc->drawSolidHorizontalLine(0, 2 * rect.h / 3, getInnerWidth(), 0); // dc->drawSolidHorizontalLine(0, 2 * rect.h / 3, getInnerWidth(), 0);
drawHorizontalScrollbar(dc); drawHorizontalScrollbar(dc);
} }
@@ -125,35 +150,35 @@ void CurveEdit::updatePreview()
invalidate(); invalidate();
} }
#if defined(HARDWARE_TOUCH) // #if defined(HARDWARE_TOUCH)
bool CurveEdit::onTouchEnd(coord_t x, coord_t y) // bool CurveEdit::onTouchEnd(coord_t x, coord_t y)
{ // {
if (!hasFocus()) { // if (!hasFocus()) {
setFocus(SET_FOCUS_DEFAULT); // setFocus(SET_FOCUS_DEFAULT);
} // }
CurveKeyboard::show(this, isCustomCurve()); // CurveKeyboard::show(this, isCustomCurve());
CurveHeader & curve = g_model.curves[index]; // CurveHeader & curve = g_model.curves[index];
for (int i=0; i<5 + curve.points; i++) { // for (int i=0; i<5 + curve.points; i++) {
if (i != current) { // if (i != current) {
point_t point = getPoint(index, i); // point_t point = getPoint(index, i);
if (abs(preview.getPointX(point.x) - x) <= 10 && abs(preview.getPointY(point.y) - y) <= 10) { // if (abs(preview.getPointX(point.x) - x) <= 10 && abs(preview.getPointY(point.y) - y) <= 10) {
current = i; // current = i;
updatePreview(); // updatePreview();
break; // break;
} // }
} // }
} // }
return true; // return true;
} // }
void CurveEdit::onFocusLost() // void CurveEdit::onFocusLost()
{ // {
CurveKeyboard::hide(); // CurveKeyboard::hide();
} // }
#endif // #endif
void CurveEdit::next() void CurveEdit::next()
{ {
+4 -5
View File
@@ -62,11 +62,10 @@ class CurveEdit: public FormField
void onEvent(event_t event) override; void onEvent(event_t event) override;
#if defined(HARDWARE_TOUCH) // #if defined(HARDWARE_TOUCH)
bool onTouchEnd(coord_t x, coord_t y) override; // bool onTouchEnd(coord_t x, coord_t y) override;
// void onFocusLost() override;
void onFocusLost() override; // #endif
#endif
protected: protected:
Curve preview; Curve preview;
+78 -74
View File
@@ -91,101 +91,104 @@ void deleteExpo(uint8_t idx)
storageDirty(EE_MODEL); storageDirty(EE_MODEL);
} }
class InputEditWindow: public Page class InputEditWindow : public Page
{ {
public: public:
InputEditWindow(int8_t input, uint8_t index): InputEditWindow(int8_t input, uint8_t index) :
Page(ICON_MODEL_INPUTS), Page(ICON_MODEL_INPUTS),
input(input), input(input),
index(index), index(index),
preview(this, {INPUT_EDIT_CURVE_LEFT, INPUT_EDIT_CURVE_TOP, INPUT_EDIT_CURVE_WIDTH, INPUT_EDIT_CURVE_HEIGHT}, preview(
[=](int x) -> int { this,
ExpoData * line = expoAddress(index); {INPUT_EDIT_CURVE_LEFT, INPUT_EDIT_CURVE_TOP, INPUT_EDIT_CURVE_WIDTH,
int16_t anas[MAX_INPUTS] = {0}; INPUT_EDIT_CURVE_HEIGHT},
applyExpos(anas, e_perout_mode_inactive_flight_mode, line->srcRaw, x); [=](int x) -> int {
return anas[line->chn]; ExpoData *line = expoAddress(index);
}, int16_t anas[MAX_INPUTS] = {0};
[=]() -> int { applyExpos(anas, e_perout_mode_inactive_flight_mode, line->srcRaw,
return getValue(expoAddress(index)->srcRaw); x);
}) return anas[line->chn];
{ },
[=]() -> int { return getValue(expoAddress(index)->srcRaw); })
{
#if LCD_W > LCD_H #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 #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 #endif
buildBody(&body); buildBody(&body);
buildHeader(&header); buildHeader(&header);
} }
void deleteLater(bool detach = true, bool trash = true) override void deleteLater(bool detach = true, bool trash = true) override
{ {
if (_deleted) if (_deleted) return;
return;
preview.deleteLater(true, false); preview.deleteLater(true, false);
Page::deleteLater(detach, trash); Page::deleteLater(detach, trash);
} }
protected: protected:
uint8_t input; uint8_t input;
uint8_t index; uint8_t index;
Curve preview; Curve preview;
Choice * trimChoice = nullptr; Choice *trimChoice = nullptr;
FormGroup * curveParamField = nullptr; FormGroup *curveParamField = nullptr;
void buildHeader(Window * window) void buildHeader(Window *window)
{ {
new StaticText(window, new StaticText(window,
{PAGE_TITLE_LEFT, PAGE_TITLE_TOP, LCD_W - PAGE_TITLE_LEFT, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP, LCD_W - PAGE_TITLE_LEFT,
PAGE_LINE_HEIGHT}, PAGE_LINE_HEIGHT},
STR_MENUINPUTS, 0,FOCUS_COLOR); STR_MENUINPUTS, 0, FOCUS_COLOR);
new StaticText(window, new StaticText(window,
{PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + PAGE_LINE_HEIGHT,
LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT},
getSourceString(MIXSRC_FIRST_INPUT + input), 0, getSourceString(MIXSRC_FIRST_INPUT + input), 0, FOCUS_COLOR);
FOCUS_COLOR); }
}
// TODO share this code with MIXER // TODO share this code with MIXER
void updateCurveParamField(ExpoData * line) void updateCurveParamField(ExpoData *line)
{ {
curveParamField->clear(); 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) { switch (line->curve.type) {
case CURVE_REF_DIFF: case CURVE_REF_DIFF:
case CURVE_REF_EXPO: case CURVE_REF_EXPO: {
{ GVarNumberEdit *edit =
GVarNumberEdit * edit = new GVarNumberEdit(curveParamField, rect, -100, 100, GET_SET_DEFAULT(line->curve.value)); new GVarNumberEdit(curveParamField, rect, -100, 100,
edit->setSuffix("%"); GET_SET_DEFAULT(line->curve.value));
break; edit->setSuffix("%");
} break;
}
case CURVE_REF_FUNC: case CURVE_REF_FUNC:
new Choice(curveParamField, rect, STR_VCURVEFUNC, 0, CURVE_BASE - 1, GET_SET_DEFAULT(line->curve.value)); new Choice(curveParamField, rect, STR_VCURVEFUNC, 0, CURVE_BASE - 1,
break; GET_SET_DEFAULT(line->curve.value));
break;
case CURVE_REF_CUSTOM: case CURVE_REF_CUSTOM: {
{ auto choice = new Choice(curveParamField, rect, -MAX_CURVES, MAX_CURVES,
auto choice = new Choice(curveParamField, rect, -MAX_CURVES, MAX_CURVES, GET_SET_DEFAULT(line->curve.value)); GET_SET_DEFAULT(line->curve.value));
choice->setTextHandler([](int value) { choice->setTextHandler([](int value) { return getCurveString(value); });
return getCurveString(value); break;
});
break;
}
} }
} }
}
void buildBody(FormWindow * window) void buildBody(FormWindow *window)
{ {
FormGridLayout grid; FormGridLayout grid;
grid.setLabelWidth(INPUT_EDIT_LABELS_WIDTH); grid.setLabelWidth(INPUT_EDIT_LABELS_WIDTH);
grid.spacer(PAGE_PADDING); grid.spacer(PAGE_PADDING);
ExpoData * line = expoAddress(index) ; ExpoData *line = expoAddress(index);
#if LCD_W > LCD_H #if LCD_W > LCD_H
grid.setMarginRight(180); grid.setMarginRight(180);
@@ -495,6 +498,7 @@ void ModelInputsPage::build(FormWindow *window, int8_t focusIndex)
txt->setTextFlags(CENTERED); txt->setTextFlags(CENTERED);
} }
txt->invalidate(); txt->invalidate();
if (focus) button->bringToTop();
}); });
if (focusIndex == inputIndex) { if (focusIndex == inputIndex) {
+23 -11
View File
@@ -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<StaticBitmap*>(child);
if (bitmap) bitmap->setMaskColor(flags & 0xFFFF0000);
}
}
};
void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex) void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex)
{ {
FormGridLayout grid; FormGridLayout grid;
@@ -349,9 +364,9 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex)
if (mixIndex < MAX_MIXERS && mix->srcRaw > 0 && mix->destCh == ch) { if (mixIndex < MAX_MIXERS && mix->srcRaw > 0 && mix->destCh == ch) {
coord_t h = grid.getWindowHeight(); coord_t h = grid.getWindowHeight();
auto txt = new StaticText(window, grid.getLabelSlot(), auto txt = new MixLineTitle(window, grid.getLabelSlot(),
getSourceString(MIXSRC_CH1 + ch), getSourceString(MIXSRC_CH1 + ch),
BUTTON_BACKGROUND, CENTERED); BUTTON_BACKGROUND, CENTERED);
uint8_t count = 0; uint8_t count = 0;
while (mixIndex < MAX_MIXERS && mix->srcRaw > 0 && mix->destCh == ch) { 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; StaticBitmap* bitmap = nullptr;
if (count++ > 0) { if (count++ > 0) {
bitmap = new StaticBitmap( 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); mixerMultiplexBitmap[mix->mltpx], DEFAULT_COLOR);
} }
@@ -416,14 +434,12 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex)
if (focus) { if (focus) {
txt->setBackgroundColor(FOCUS_BGCOLOR); txt->setBackgroundColor(FOCUS_BGCOLOR);
txt->setTextFlags(FOCUS_COLOR | CENTERED); txt->setTextFlags(FOCUS_COLOR | CENTERED);
if (bitmap) bitmap->setMaskColor(FOCUS_COLOR);
} else { } else {
txt->setBackgroundColor(FIELD_FRAME_COLOR); txt->setBackgroundColor(FIELD_FRAME_COLOR);
txt->setTextFlags(CENTERED); txt->setTextFlags(CENTERED);
if (bitmap) bitmap->setMaskColor(DEFAULT_COLOR);
} }
txt->invalidate(); txt->invalidate();
if (bitmap) bitmap->invalidate(); if (focus) button->bringToTop();
}); });
if (focusMixIndex == mixIndex) { if (focusMixIndex == mixIndex) {
@@ -431,10 +447,6 @@ void ModelMixesPage::build(FormWindow * window, int8_t focusMixIndex)
txt->setBackgroundColor(FOCUS_BGCOLOR); txt->setBackgroundColor(FOCUS_BGCOLOR);
txt->setTextFlags(FOCUS_COLOR | CENTERED); txt->setTextFlags(FOCUS_COLOR | CENTERED);
txt->invalidate(); txt->invalidate();
if (bitmap) {
bitmap->setMaskColor(FOCUS_COLOR);
bitmap->invalidate();
}
} }
+5 -1
View File
@@ -34,7 +34,11 @@ std::string switchWarninglabel(swsrc_t index)
CHAR_DOWN 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 { class ChannelFailsafeBargraph: public Window {
+2
View File
@@ -71,6 +71,8 @@ void SourceChoice::paint(BitmapBuffer * dc)
textColor = 0; textColor = 0;
drawSource(dc, FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value, textColor); 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 // defined in gui/gui_common.cpp
+2
View File
@@ -55,6 +55,8 @@ void SwitchChoice::paint(BitmapBuffer * dc)
textColor = DEFAULT_COLOR; textColor = DEFAULT_COLOR;
drawSwitch(dc, FIELD_PADDING_LEFT, FIELD_PADDING_TOP, value, textColor); 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<bool(int16_t)> filter) void SwitchChoice::fillMenu(Menu * menu, std::function<bool(int16_t)> filter)
+2
View File
@@ -124,4 +124,6 @@ void loadTheme();
std::list<OpenTxTheme *> & getRegisteredThemes(); std::list<OpenTxTheme *> & getRegisteredThemes();
extern const uint8_t LBM_DROPDOWN[];
#endif // _COLORLCD_THEME_H_ #endif // _COLORLCD_THEME_H_
+3 -3
View File
@@ -46,9 +46,9 @@ class ChannelsViewFooter: public Window {
// Draw single legend // Draw single legend
coord_t drawChannelsMonitorLegend(BitmapBuffer * dc, coord_t x, const char * s, int color) 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, 4, LEG_COLORBOX + 2, LEG_COLORBOX + 2, BARGRAPH_BGCOLOR);
dc->drawSolidFilledRect(x + 1, 3, LEG_COLORBOX, LEG_COLORBOX, color); dc->drawSolidFilledRect(x + 1, 5, LEG_COLORBOX, LEG_COLORBOX, color);
dc->drawText(x + 20, 2, s, TEXT_STATUSBAR_COLOR); dc->drawText(x + 20, 4, s, TEXT_STATUSBAR_COLOR);
return x + 25 + getTextWidth(s); return x + 25 + getTextWidth(s);
} }
+3 -3
View File
@@ -106,9 +106,9 @@ constexpr uint32_t PAGE_TITLE_LEFT = 50;
constexpr uint32_t INPUT_EDIT_LABELS_WIDTH = 120; constexpr uint32_t INPUT_EDIT_LABELS_WIDTH = 120;
constexpr coord_t INPUT_EDIT_CURVE_WIDTH = 158; 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_HEIGHT = INPUT_EDIT_CURVE_WIDTH;
constexpr coord_t INPUT_EDIT_CURVE_LEFT = LCD_W - 158; constexpr coord_t INPUT_EDIT_CURVE_LEFT = PAGE_PADDING;
constexpr coord_t INPUT_EDIT_CURVE_TOP = MENU_HEADER_HEIGHT; constexpr coord_t INPUT_EDIT_CURVE_TOP = MENU_HEADER_HEIGHT + PAGE_PADDING;
constexpr coord_t MENUS_LINE_HEIGHT = 30; constexpr coord_t MENUS_LINE_HEIGHT = 30;
constexpr coord_t MENUS_WIDTH = 200; constexpr coord_t MENUS_WIDTH = 200;
constexpr coord_t MENUS_OFFSET_TOP = 20; constexpr coord_t MENUS_OFFSET_TOP = 20;