diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-04-04 19:38:06 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-04-04 19:38:06 +0800 |
| commit | 77a4d6f3ca3a506f24a64262f09456058247b1bb (patch) | |
| tree | 1ab1c10f1eb739712fb12845e99df645999f5c46 /bootstrap.hxx | |
Initial commit, draft that compiles
Diffstat (limited to 'bootstrap.hxx')
| -rw-r--r-- | bootstrap.hxx | 54 |
1 files changed, 54 insertions, 0 deletions
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 <QObject> +#include <QtQml> + +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 |