mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
UI
Add led element
This commit is contained in:
@@ -13,6 +13,7 @@ target_sources(UI
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
${CMAKE_CURRENT_LIST_DIR}/UI_item.cpp
|
${CMAKE_CURRENT_LIST_DIR}/UI_item.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/UI_label.cpp
|
${CMAKE_CURRENT_LIST_DIR}/UI_label.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/UI_led.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/UI_button.cpp
|
${CMAKE_CURRENT_LIST_DIR}/UI_button.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/UI_slider.cpp
|
${CMAKE_CURRENT_LIST_DIR}/UI_slider.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/UI_x_boxes.cpp
|
${CMAKE_CURRENT_LIST_DIR}/UI_x_boxes.cpp
|
||||||
|
|||||||
@@ -4,4 +4,5 @@
|
|||||||
#include "UI_checkbox.hpp"
|
#include "UI_checkbox.hpp"
|
||||||
#include "UI_combobox.hpp"
|
#include "UI_combobox.hpp"
|
||||||
#include "UI_label.hpp"
|
#include "UI_label.hpp"
|
||||||
|
#include "UI_led.hpp"
|
||||||
#include "UI_slider.hpp"
|
#include "UI_slider.hpp"
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#include "UI_led.hpp"
|
||||||
|
|
||||||
|
UI_led::UI_led(std::string id, std::string text, Color fg_color, Color bg_color) :
|
||||||
|
UI_item(id, UI_LED_TYPE, text, 12, fg_color, bg_color)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
UI_led::UI_led(const json& j) : UI_item(j)
|
||||||
|
{
|
||||||
|
from_json(j);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UI_led::from_json(const json& j)
|
||||||
|
{
|
||||||
|
UI_item::from_json(j);
|
||||||
|
}
|
||||||
|
|
||||||
|
json UI_led::to_json() const
|
||||||
|
{
|
||||||
|
return UI_item::to_json();
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <string>
|
||||||
|
#include "UI_item.hpp"
|
||||||
|
|
||||||
|
#define UI_LED_TYPE std::string("UIled")
|
||||||
|
|
||||||
|
class UI_led : public UI_item
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
UI_led(std::string id, std::string text, Color fg_color, Color bg_color);
|
||||||
|
UI_led(const json& j);
|
||||||
|
|
||||||
|
void from_json(const json& j) override;
|
||||||
|
json to_json() const override;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user