add set led funtion
This commit is contained in:
2026-02-14 14:30:47 +01:00
parent 90030e2c65
commit 6db7e81f0b
3 changed files with 16 additions and 0 deletions
+5
View File
@@ -10,6 +10,11 @@ UI_led::UI_led(const json &j, QObject *parent) : UI_item(UI_LED_TYPE, parent)
from_json(j);
}
void UI_led::set_led(bool state, Color on, Color off)
{
set_bg_color(state ? on : off);
}
void UI_led::from_json(const json &j)
{
UI_item::from_json(j);
+2
View File
@@ -11,6 +11,8 @@ class UI_led : public UI_item
UI_led(std::string text, Color fg_color, Color bg_color, QObject *parent = nullptr);
UI_led(const json &j, QObject *parent = nullptr);
void set_led(bool state, Color on, Color off);
void from_json(const json &j) override;
json to_json(size_t id) const override;
};