made the current theme writable via a property

This commit is contained in:
Dorian Zedler 2020-08-09 11:46:13 +02:00
parent b904566977
commit ec2d6fb9ef
Signed by: dorian
GPG key ID: D3B255CB8BC7CD37
2 changed files with 6 additions and 0 deletions

View file

@ -27,6 +27,7 @@ class ScStwAppThemeManager : public QObject
{
Q_OBJECT
Q_PROPERTY(ScStwAppTheme* theme READ getTheme NOTIFY themeChanged)
Q_PROPERTY(QString themeName READ getThemeName WRITE setTheme NOTIFY themeChanged)
public:
explicit ScStwAppThemeManager(QObject *parent = nullptr);
@ -45,6 +46,7 @@ signals:
public slots:
ScStwAppTheme* getTheme();
Q_INVOKABLE bool setTheme(QString themeName);
Q_INVOKABLE QString getThemeName();
};

View file

@ -174,3 +174,7 @@ QString ScStwAppThemeManager::lighter(QString color, double factor) {
qcolor.setHsv(h,s,v * factor);
return qcolor.name();
}
QString ScStwAppThemeManager::getThemeName() {
return this->currentTheme->getName();
}