From a0096545d2bffc622167d3164c328af8308cc93b 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: Wed, 5 Apr 2023 21:31:27 +0800 Subject: Simplify & make it usable --- bootstrap.hxx | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'bootstrap.hxx') diff --git a/bootstrap.hxx b/bootstrap.hxx index a0eccc3..dc1a1dd 100644 --- a/bootstrap.hxx +++ b/bootstrap.hxx @@ -1,25 +1,19 @@ #ifndef BOOTSTRAP_HXX #define BOOTSTRAP_HXX -#include #include -class Bootstrap : public QObject +class Bootstrap : public QQmlEngineExtensionPlugin { Q_OBJECT - Q_PROPERTY(Theme theme READ theme WRITE setTheme NOTIFY themeChanged) + Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) 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 { + enum Purpose { None, Primary, Secondary, @@ -31,21 +25,14 @@ class Bootstrap : public QObject 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; }; -- cgit v1.2.3