mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
UI
add set led funtion
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user