This repository has been archived on 2024-06-03. You can view files and clone it, but cannot push or open issues or pull requests.
shared-libraries/ScStwStyling/headers/scstwapptheme.h

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