From 77a4d6f3ca3a506f24a64262f09456058247b1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Tue, 4 Apr 2023 19:38:06 +0800 Subject: Initial commit, draft that compiles --- bootstrap.hxx | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 bootstrap.hxx (limited to 'bootstrap.hxx') diff --git a/bootstrap.hxx b/bootstrap.hxx new file mode 100644 index 0000000..a0eccc3 --- /dev/null +++ b/bootstrap.hxx @@ -0,0 +1,54 @@ +#ifndef BOOTSTRAP_HXX +#define BOOTSTRAP_HXX + +#include +#include + +class Bootstrap : public QObject +{ + Q_OBJECT + Q_PROPERTY(Theme theme READ theme WRITE setTheme NOTIFY themeChanged) + Q_PROPERTY(Purpose purpose READ purpose WRITE setPurpose NOTIFY purposeChanged) + + public: + explicit Bootstrap(QObject *parent = nullptr); + static Bootstrap *qmlAttachedProperties(QObject *object); + + enum class Theme { + Light, + Dark + }; + + enum class Purpose { + None, + Primary, + Secondary, + Success, + Danger, + Warning, + Info, + Light, + Dark, + Link + }; + + Q_ENUM(Theme) + Q_ENUM(Purpose) + + Theme theme() const; + void setTheme(Theme theme); + Purpose purpose() const; + void setPurpose(Purpose purpose); + + signals: + void themeChanged(); + void purposeChanged(); + + private: + Theme m_theme; + Purpose m_purpose; +}; + +QML_DECLARE_TYPEINFO(Bootstrap, QML_HAS_ATTACHED_PROPERTIES) + +#endif -- cgit v1.2.3