mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
29 lines
650 B
C++
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;
|
|
};
|