More color fixes, set background of FormField

This commit is contained in:
kkoenig1@optonline.com
2021-09-29 10:56:55 +10:00
committed by Peter Feerick
parent d862cd6a8c
commit 3ebd4321eb
3 changed files with 13 additions and 6 deletions
+6
View File
@@ -44,6 +44,11 @@ class FormField: public Window
changeHandler = std::move(handler);
}
void setBackgroundHandler(std::function<uint32_t(FormField *field)> handler)
{
backgroundHandler = std::move(handler);
}
inline void setNextField(FormField *field)
{
next = field;
@@ -117,6 +122,7 @@ class FormField: public Window
bool editMode = false;
bool enabled = true;
std::function<void()> changeHandler = nullptr;
std::function<uint32_t(FormField *)> backgroundHandler = nullptr;
};
class FormGroup: public FormField
+5 -4
View File
@@ -23,8 +23,9 @@
class GridLayout {
public:
explicit GridLayout(coord_t width):
width(width)
explicit GridLayout(coord_t width, coord_t top = 0):
width(width),
currentY(top)
{
}
@@ -68,8 +69,8 @@ class GridLayout {
class FormGridLayout: public GridLayout {
public:
explicit FormGridLayout(coord_t width = LCD_W):
GridLayout(width)
explicit FormGridLayout(coord_t width = LCD_W, coord_t top = 0):
GridLayout(width, top)
{
}
+2 -2
View File
@@ -41,12 +41,12 @@ void ModalWindow::deleteLater(bool detach, bool trash)
void ModalWindow::paint(BitmapBuffer * dc)
{
dc->drawFilledRect(0, 0, width(), height(), SOLID, COLOR_THEME_SECONDARY3, OPACITY(5));
dc->drawFilledRect(0, 0, width(), height(), SOLID, BLACK, OPACITY(6));
}
void ModalWindowContent::paint(BitmapBuffer * dc)
{
dc->drawSolidFilledRect(0, 0, width(), POPUP_HEADER_HEIGHT, COLOR_THEME_FOCUS);
dc->drawSolidFilledRect(0, 0, width(), POPUP_HEADER_HEIGHT, COLOR_THEME_SECONDARY1);
dc->drawText(FIELD_PADDING_LEFT, (POPUP_HEADER_HEIGHT - getFontHeight(FONT(STD))) / 2, title.c_str(), COLOR_THEME_PRIMARY2);
dc->drawSolidFilledRect(0, POPUP_HEADER_HEIGHT, width(), height() - POPUP_HEADER_HEIGHT, COLOR_THEME_SECONDARY3);
}