A bit more tuning

This commit is contained in:
Raphael Coeffic
2021-06-14 06:35:12 +02:00
parent f8042ee2e0
commit 54a87bc180
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ void FormGroup::paint(BitmapBuffer * dc)
dc->drawSolidRect(0, 0, rect.w, rect.h, 2, FOCUS_BGCOLOR); dc->drawSolidRect(0, 0, rect.w, rect.h, 2, FOCUS_BGCOLOR);
} }
else if (!(windowFlags & FORM_BORDER_FOCUS_ONLY)) { else if (!(windowFlags & FORM_BORDER_FOCUS_ONLY)) {
dc->drawSolidRect(0, 0, rect.w, rect.h, 1, DISABLE_COLOR); dc->drawSolidRect(0, 0, rect.w, rect.h, 1, FIELD_FRAME_COLOR);
} }
} }
} }
+6 -4
View File
@@ -34,21 +34,23 @@ void StaticText::paint(BitmapBuffer * dc)
else else
x = 0; x = 0;
coord_t y = (textFlags & VCENTERED) ? (rect.h - getFontHeight(textFlags)) / 2 : FIELD_PADDING_TOP; coord_t y = (textFlags & VCENTERED) ? (rect.h - getFontHeight(textFlags)) / 2
: FIELD_PADDING_TOP;
auto start = text.c_str(); auto start = text.c_str();
auto nextline = findNextLine(start); auto nextline = findNextLine(start);
if (nextline) { if (nextline) {
auto current = start; auto current = start;
do { do {
dc->drawText(x, y, text.substr(current - start, nextline - current).c_str(), textFlags); dc->drawText(x, y,
text.substr(current - start, nextline - current).c_str(),
textFlags);
current = nextline + 1; current = nextline + 1;
nextline = findNextLine(current); nextline = findNextLine(current);
y += getFontHeight(textFlags) + 2; y += getFontHeight(textFlags) + 2;
} while (nextline); } while (nextline);
dc->drawText(x, y, current, textFlags); dc->drawText(x, y, current, textFlags);
} } else {
else {
dc->drawText(x, y, start, textFlags); dc->drawText(x, y, start, textFlags);
} }
} }