TextButton: rely on LVGL theme for text color (#67)

This commit is contained in:
Raphael Coeffic
2022-09-27 12:11:45 +10:00
committed by GitHub
parent 8ad593594b
commit 01d7036e78
2 changed files with 3 additions and 6 deletions
+2 -4
View File
@@ -102,12 +102,10 @@ void Button::long_pressed(lv_event_t* e)
TextButton::TextButton(Window* parent, const rect_t& rect, std::string text, TextButton::TextButton(Window* parent, const rect_t& rect, std::string text,
std::function<uint8_t(void)> pressHandler, std::function<uint8_t(void)> pressHandler,
WindowFlags windowFlags, LcdFlags textFlags) : WindowFlags windowFlags) :
Button(parent, rect, std::move(pressHandler), windowFlags, textFlags, Button(parent, rect, std::move(pressHandler), windowFlags, 0, lv_btn_create),
lv_btn_create),
text(std::move(text)) text(std::move(text))
{ {
setTextFlags(textFlags | COLOR_THEME_PRIMARY1);
update_checked_flag(lvobj, windowFlags); update_checked_flag(lvobj, windowFlags);
label = lv_label_create(lvobj); label = lv_label_create(lvobj);
+1 -2
View File
@@ -78,8 +78,7 @@ class TextButton: public Button
public: public:
TextButton(Window* parent, const rect_t& rect, std::string text, TextButton(Window* parent, const rect_t& rect, std::string text,
std::function<uint8_t(void)> pressHandler = nullptr, std::function<uint8_t(void)> pressHandler = nullptr,
WindowFlags windowFlags = BUTTON_BACKGROUND | OPAQUE, WindowFlags windowFlags = BUTTON_BACKGROUND | OPAQUE);
LcdFlags textFlags = 0);
#if defined(DEBUG_WINDOWS) #if defined(DEBUG_WINDOWS)
std::string getName() const override std::string getName() const override