More color fixes, set background of FormField
This commit is contained in:
committed by
Peter Feerick
parent
d862cd6a8c
commit
3ebd4321eb
+6
@@ -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
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user