lcdNextPos not needed anymore
This commit is contained in:
@@ -29,10 +29,10 @@ class OptionsText : public StaticText {
|
|||||||
StaticText(parent, rect)
|
StaticText(parent, rect)
|
||||||
{
|
{
|
||||||
coord_t optionWidth = 0;
|
coord_t optionWidth = 0;
|
||||||
for (uint8_t i=0; options[i]; i++) {
|
for (uint8_t i = 0; options[i]; i++) {
|
||||||
const char * option = options[i];
|
const char * option = options[i];
|
||||||
optionWidth+= getTextWidth(option);
|
optionWidth += getTextWidth(option);
|
||||||
if(optionWidth + 5 > width()) {
|
if (optionWidth + 5 > width()) {
|
||||||
setHeight(getHeight() + 20);
|
setHeight(getHeight() + 20);
|
||||||
optionWidth = 0;
|
optionWidth = 0;
|
||||||
}
|
}
|
||||||
@@ -42,23 +42,20 @@ class OptionsText : public StaticText {
|
|||||||
void paint(BitmapBuffer * dc) override
|
void paint(BitmapBuffer * dc) override
|
||||||
{
|
{
|
||||||
coord_t y = 0;
|
coord_t y = 0;
|
||||||
lcdNextPos = 0;
|
coord_t x = 0;
|
||||||
for (uint8_t i=0; options[i]; i++) {
|
for (uint8_t i = 0; options[i]; i++) {
|
||||||
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 (lcdNextPos + 5 + optionWidth > width()) {
|
dc->drawText(x, y, ",");
|
||||||
dc->drawText(lcdNextPos, y, ",");
|
x = 0;
|
||||||
lcdNextPos = 0;
|
|
||||||
y += FH;
|
y += FH;
|
||||||
}
|
}
|
||||||
if (i > 0 && lcdNextPos != 0)
|
if (i > 0 && x != 0)
|
||||||
dc->drawText(lcdNextPos, y, ", ");
|
x = dc->drawText(x, y, ", ");
|
||||||
dc->drawText(lcdNextPos, y, option);
|
x = dc->drawText(x, y, option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
RadioVersionPage::RadioVersionPage():
|
RadioVersionPage::RadioVersionPage():
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 3951b55749...5b4ee51fe3
Reference in New Issue
Block a user