mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Update UI
This commit is contained in:
+32
-9
@@ -1,24 +1,47 @@
|
||||
#include "ui_button.hpp"
|
||||
#include "ui_enum.hpp"
|
||||
|
||||
UI_button::UI_button(std::string text, Color fg_color, Color bg_color, QObject *parent)
|
||||
: UI_item(UI_enum::ui_button, text, fg_color, bg_color, parent)
|
||||
UI_button::UI_button(QString text, Color fg_color, Color bg_color, QObject *parent)
|
||||
: UI_item(UI_typeGadget::UI_type::ui_button, parent)
|
||||
{
|
||||
m_ui_item.setLabel(UI_label_m());
|
||||
m_ui_item.label().setText(text);
|
||||
m_ui_item.label().mutColor().setFgColor(fg_color.color());
|
||||
m_ui_item.label().mutColor().setBgColor(bg_color.color());
|
||||
}
|
||||
|
||||
UI_button::UI_button(QObject *parent) : UI_item(UI_enum::ui_button, parent)
|
||||
UI_button::UI_button(QObject *parent) : UI_item(UI_typeGadget::UI_type::ui_button, parent)
|
||||
{
|
||||
m_ui_item.setLabel(UI_label_m());
|
||||
}
|
||||
|
||||
void UI_button::from_json(const json &j)
|
||||
void UI_button::set_text(QString text)
|
||||
{
|
||||
UI_item::from_json(j);
|
||||
m_ui_item.label().setText(text);
|
||||
}
|
||||
|
||||
json UI_button::to_json(size_t id) const
|
||||
QString UI_button::text() const
|
||||
{
|
||||
json j = UI_item::to_json(id);
|
||||
return j;
|
||||
return m_ui_item.label().text();
|
||||
}
|
||||
|
||||
void UI_button::set_fg_color(Color color)
|
||||
{
|
||||
m_ui_item.label().mutColor().setFgColor(color.color());
|
||||
}
|
||||
|
||||
Color UI_button::fg_color() const
|
||||
{
|
||||
return Color(m_ui_item.label().color().fgColor());
|
||||
}
|
||||
|
||||
void UI_button::set_bg_color(Color color)
|
||||
{
|
||||
m_ui_item.label().mutColor().setBgColor(color.color());
|
||||
}
|
||||
|
||||
Color UI_button::bg_color() const
|
||||
{
|
||||
return Color(m_ui_item.label().color().bgColor());
|
||||
}
|
||||
|
||||
void UI_button::click()
|
||||
|
||||
Reference in New Issue
Block a user