Cosmetics

This commit is contained in:
Bertrand Songis
2019-10-05 19:35:52 +02:00
parent f23021226d
commit e7773df205
2 changed files with 6 additions and 2 deletions
+3 -2
View File
@@ -32,17 +32,18 @@ void NumberEdit::paint(BitmapBuffer * dc)
{
FormField::paint(dc);
auto value = getValue();
LcdFlags textColor;
if (editMode)
textColor = FOCUS_COLOR;
else if (hasFocus())
textColor = FOCUS_BGCOLOR;
else if (enabled)
else if (enabled && (value != 0 || zeroText.empty()))
textColor = DEFAULT_COLOR;
else
textColor = DISABLE_COLOR;
int32_t value = getValue();
if (displayFunction)
displayFunction(dc, textColor, value);
else if (value == 0 && !zeroText.empty())
+3
View File
@@ -44,6 +44,9 @@ void TextEdit::paint(BitmapBuffer * dc)
const char * displayedValue = value;
LcdFlags textColor;
if (hasFocus()) {
if (strlen(value) == 0) {
displayedValue = "---";
}
textColor = FOCUS_BGCOLOR;
}
else {