made the current theme writable via a property
This commit is contained in:
parent
b904566977
commit
ec2d6fb9ef
2 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Reference in a new issue