Cosmetics
This commit is contained in:
+3
-2
@@ -32,17 +32,18 @@ void NumberEdit::paint(BitmapBuffer * dc)
|
|||||||
{
|
{
|
||||||
FormField::paint(dc);
|
FormField::paint(dc);
|
||||||
|
|
||||||
|
auto value = getValue();
|
||||||
|
|
||||||
LcdFlags textColor;
|
LcdFlags textColor;
|
||||||
if (editMode)
|
if (editMode)
|
||||||
textColor = FOCUS_COLOR;
|
textColor = FOCUS_COLOR;
|
||||||
else if (hasFocus())
|
else if (hasFocus())
|
||||||
textColor = FOCUS_BGCOLOR;
|
textColor = FOCUS_BGCOLOR;
|
||||||
else if (enabled)
|
else if (enabled && (value != 0 || zeroText.empty()))
|
||||||
textColor = DEFAULT_COLOR;
|
textColor = DEFAULT_COLOR;
|
||||||
else
|
else
|
||||||
textColor = DISABLE_COLOR;
|
textColor = DISABLE_COLOR;
|
||||||
|
|
||||||
int32_t value = getValue();
|
|
||||||
if (displayFunction)
|
if (displayFunction)
|
||||||
displayFunction(dc, textColor, value);
|
displayFunction(dc, textColor, value);
|
||||||
else if (value == 0 && !zeroText.empty())
|
else if (value == 0 && !zeroText.empty())
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ void TextEdit::paint(BitmapBuffer * dc)
|
|||||||
const char * displayedValue = value;
|
const char * displayedValue = value;
|
||||||
LcdFlags textColor;
|
LcdFlags textColor;
|
||||||
if (hasFocus()) {
|
if (hasFocus()) {
|
||||||
|
if (strlen(value) == 0) {
|
||||||
|
displayedValue = "---";
|
||||||
|
}
|
||||||
textColor = FOCUS_BGCOLOR;
|
textColor = FOCUS_BGCOLOR;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user