[Button] Add textFlags to constructor

This commit is contained in:
Bertrand Songis
2020-12-17 10:10:58 +01:00
parent d6612cd61e
commit 445fd941cc
+4 -4
View File
@@ -28,8 +28,8 @@ constexpr WindowFlags BUTTON_CHECKED_ON_FOCUS = FORM_FLAGS_LAST << 3u;
class Button: public FormField
{
public:
Button(FormGroup * parent, const rect_t & rect, std::function<uint8_t(void)> pressHandler = nullptr, WindowFlags windowFlags = 0):
FormField(parent, rect, windowFlags),
Button(FormGroup * parent, const rect_t & rect, std::function<uint8_t(void)> pressHandler = nullptr, WindowFlags windowFlags = 0, LcdFlags textFlags = 0):
FormField(parent, rect, windowFlags, textFlags),
pressHandler(std::move(pressHandler))
{
}
@@ -87,8 +87,8 @@ class Button: public FormField
class TextButton: public Button
{
public:
TextButton(FormGroup * parent, const rect_t & rect, std::string text, std::function<uint8_t(void)> pressHandler = nullptr, WindowFlags windowFlags = BUTTON_BACKGROUND):
Button(parent, rect, std::move(pressHandler), windowFlags | OPAQUE),
TextButton(FormGroup * parent, const rect_t & rect, std::string text, std::function<uint8_t(void)> pressHandler = nullptr, WindowFlags windowFlags = BUTTON_BACKGROUND, LcdFlags textFlags = 0):
Button(parent, rect, std::move(pressHandler), windowFlags | OPAQUE, textFlags),
text(std::move(text))
{
}