37 lines
619 B
C++
37 lines
619 B
C++
#ifndef APPTHEME_H
|
|
#define APPTHEME_H
|
|
|
|
#include <QObject>
|
|
#include <QVariant>
|
|
|
|
class ScStwAppTheme : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(QVariant style READ getStyle NOTIFY styleChanged)
|
|
public:
|
|
explicit ScStwAppTheme(QObject *parent = nullptr);
|
|
|
|
enum Theme {
|
|
Light,
|
|
Dark
|
|
};
|
|
Q_ENUM(Theme)
|
|
|
|
private:
|
|
QMap<Theme, QVariantMap> themes;
|
|
|
|
QVariantMap * currentTheme;
|
|
|
|
Theme currentThemeKey;
|
|
|
|
signals:
|
|
void styleChanged();
|
|
|
|
public slots:
|
|
QVariant getStyle();
|
|
Q_INVOKABLE bool setTheme(Theme theme);
|
|
Q_INVOKABLE void refreshTheme();
|
|
};
|
|
|
|
#endif // APPTHEME_H
|