Add setFont and setBackgroudOpacity to StaticText (#73)

This commit is contained in:
Malte Langermann
2022-10-06 16:16:32 +10:00
committed by GitHub
parent ba56990950
commit ca43d52960
2 changed files with 13 additions and 0 deletions
+10
View File
@@ -75,6 +75,16 @@ void StaticText::setBackgroundColor(LcdFlags color)
lv_obj_set_style_bg_color(lvobj, c, LV_PART_MAIN);
}
void StaticText::setBackgroudOpacity(uint32_t opa)
{
lv_obj_set_style_bg_opa(lvobj, opa, LV_PART_MAIN);
}
void StaticText::setFont(LcdFlags font)
{
lv_obj_set_style_text_font(lvobj, getFont(font), 0);
}
template <>
void DynamicNumber<uint32_t>::updateText()
{
+3
View File
@@ -36,6 +36,9 @@ class StaticText: public Window
const std::string& getText() const;
void setBackgroundColor(LcdFlags color);
void setBackgroudOpacity(uint32_t opa);
void setFont(LcdFlags font);
protected:
std::string text;