From 327055934009dc416be6234db8e4d26fab81fb80 Mon Sep 17 00:00:00 2001
From: SineStriker <55847490+SineStriker@users.noreply.github.com>
Date: 摹曛, 21 12月 2023 23:21:28 +0800
Subject: [PATCH] Merge pull request #8 from stdware/stylesupport

---
 src/stylesupport/styleagent.h |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/src/stylesupport/styleagent.h b/src/stylesupport/styleagent.h
new file mode 100644
index 0000000..94afa33
--- /dev/null
+++ b/src/stylesupport/styleagent.h
@@ -0,0 +1,47 @@
+#ifndef STYLEAGENT_H
+#define STYLEAGENT_H
+
+#include <memory>
+
+#include <QtCore/QObject>
+#include <QtGui/QWindow>
+
+#include <QWKStyleSupport/qwkstylesupportglobal.h>
+
+namespace QWK {
+
+    class StyleAgentPrivate;
+
+    class QWK_STYLESUPPORT_EXPORT StyleAgent : public QObject {
+        Q_OBJECT
+        Q_DECLARE_PRIVATE(StyleAgent)
+    public:
+        explicit StyleAgent(QObject *parent = nullptr);
+        ~StyleAgent() override;
+
+        enum SystemTheme {
+            Unknown,
+            Light,
+            Dark,
+            HighContrast,
+        };
+        Q_ENUM(SystemTheme)
+
+    public:
+        SystemTheme systemTheme() const;
+
+        QVariant windowAttribute(QWindow *window, const QString &key) const;
+        bool setWindowAttribute(QWindow *window, const QString &key, const QVariant &attribute);
+
+    Q_SIGNALS:
+        void systemThemeChanged(); // Do we need wallpaper change notify?
+
+    protected:
+        StyleAgent(StyleAgentPrivate &d, QObject *parent = nullptr);
+
+        const std::unique_ptr<StyleAgentPrivate> d_ptr;
+    };
+
+}
+
+#endif // STYLEAGENT_H
\ No newline at end of file

--
Gitblit v1.9.1