Forms refactoring

This commit is contained in:
Bertrand Songis
2019-10-18 22:13:49 +02:00
parent e9b822aa2f
commit a98b0a4f79
17 changed files with 204 additions and 211 deletions
+4 -12
View File
@@ -25,10 +25,9 @@
class StaticText : public Window {
public:
StaticText(Window * parent, const rect_t & rect, std::string text = "", LcdFlags flags = 0) :
Window(parent, rect),
text(std::move(text)),
flags(flags)
StaticText(Window * parent, const rect_t & rect, std::string text = "", WindowFlags windowFlags = 0, LcdFlags textFlags = 0) :
Window(parent, rect, windowFlags, textFlags),
text(std::move(text))
{
}
@@ -39,12 +38,6 @@ class StaticText : public Window {
}
#endif
void setFlags(LcdFlags flags)
{
this->flags = flags;
invalidate();
}
void paint(BitmapBuffer * dc) override;
void setText(std::string value)
@@ -55,13 +48,12 @@ class StaticText : public Window {
protected:
std::string text;
LcdFlags flags;
};
class Subtitle: public StaticText {
public:
Subtitle(Window * parent, const rect_t & rect, const char * text):
StaticText(parent, rect, text, BOLD)
StaticText(parent, rect, text, 0, BOLD)
{
}