Files
remote-ui/src/UI/UI_checkbox.hpp
T
sani7 f64df41df8 UI
Make a checkbox a UI item instead of UI_x_boxes
2024-10-17 10:21:06 +02:00

29 lines
650 B
C++

#pragma once
#include "UI_item.hpp"
#include <cstdint>
#define UI_CHECKBOX_TYPE std::string("UI_checkbox")
class UI_checkbox : public UI_item
{
Q_OBJECT
public:
UI_checkbox(QObject *parrent = nullptr);
UI_checkbox(std::string text, Color fg_color, Color bg_color,
QObject *parrent = nullptr);
UI_checkbox(const json &j, QObject *parrent = nullptr);
void toggle_selected();
bool selected() const;
std::string selected_text() const;
void from_json(const json &j) override;
json to_json(size_t id) const override;
signals:
void on_change(std::string);
private:
bool m_selected;
};