- added function to refresh the theme
- added more colors
This commit is contained in:
parent
a6fd19dd73
commit
80e4fcfafc
2 changed files with 18 additions and 0 deletions
|
@ -25,6 +25,7 @@ signals:
|
|||
public slots:
|
||||
QVariant getStyle();
|
||||
Q_INVOKABLE void changeTheme();
|
||||
Q_INVOKABLE void refreshTheme();
|
||||
};
|
||||
|
||||
#endif // APPTHEME_H
|
||||
|
|
|
@ -16,6 +16,8 @@ AppTheme::AppTheme(QObject *parent) : QObject(parent)
|
|||
|
||||
{"delegate1Color", "#202227"},
|
||||
{"delegate2Color", "#202227"},
|
||||
{"delegateBackgroundColor", "#202227"},
|
||||
{"delegatePressedColor", "#41454f"},
|
||||
|
||||
{"textColor", "#ffffff"},
|
||||
{"textDarkColor", "#232323"},
|
||||
|
@ -50,6 +52,8 @@ AppTheme::AppTheme(QObject *parent) : QObject(parent)
|
|||
|
||||
{"delegate1Color", "#202227"},
|
||||
{"delegate2Color", "#202227"},
|
||||
{"delegateBackgroundColor", "white"},
|
||||
{"delegatePressedColor", "#dddedf"},
|
||||
|
||||
{"textColor", "black"},
|
||||
{"textDarkColor", "#232323"},
|
||||
|
@ -109,3 +113,16 @@ void AppTheme::changeTheme() {
|
|||
|
||||
emit this->styleChanged();
|
||||
}
|
||||
|
||||
void AppTheme::refreshTheme() {
|
||||
QString currentThemeString = pGlobalAppSettings->loadSetting("theme");
|
||||
|
||||
if(currentThemeString == "Light"){
|
||||
this->currentTheme = &this->lightTheme;
|
||||
}
|
||||
else if (currentThemeString == "Dark") {
|
||||
this->currentTheme = &this->darkTheme;
|
||||
}
|
||||
|
||||
emit this->styleChanged();
|
||||
}
|
||||
|
|
Reference in a new issue