mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Move to Qt
Everything seems to be working Only timer is not moved over
This commit is contained in:
+9
-5
@@ -1,11 +1,11 @@
|
||||
#include "UI_led.hpp"
|
||||
|
||||
UI_led::UI_led(std::string id, std::string text, Color fg_color, Color bg_color, Color led_color)
|
||||
: UI_item(id, UI_LED_TYPE, text, 12, fg_color, bg_color), m_led_color(led_color)
|
||||
UI_led::UI_led(std::string id, std::string text, Color fg_color, Color bg_color, Color led_color, QObject* parrent)
|
||||
: UI_item(id, UI_LED_TYPE, text, 12, fg_color, bg_color, parrent), m_led_color(led_color)
|
||||
{
|
||||
}
|
||||
|
||||
UI_led::UI_led(const json &j) : UI_item(UI_LED_TYPE)
|
||||
UI_led::UI_led(const json &j, QObject* parrent) : UI_item(UI_LED_TYPE, parrent)
|
||||
{
|
||||
from_json(j);
|
||||
}
|
||||
@@ -17,7 +17,11 @@ Color UI_led::led_color() const
|
||||
|
||||
void UI_led::set_led_color(Color led_color)
|
||||
{
|
||||
m_led_color = led_color;
|
||||
if (m_led_color != led_color)
|
||||
{
|
||||
m_led_color = led_color;
|
||||
emit value_changed();
|
||||
}
|
||||
}
|
||||
|
||||
void UI_led::from_json(const json &j)
|
||||
@@ -33,4 +37,4 @@ json UI_led::to_json() const
|
||||
json j = UI_item::to_json();
|
||||
j["led_color"] = m_led_color.to_hex();
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user