TextButton: rely on LVGL theme for text color (#67)
This commit is contained in:
+2
-4
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user