mobile-widgets: replace qmlprefs::theme with qPrefDisplay::theme

Shortcut and use qPrefDisplay::theme() direct

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-09-12 13:50:24 +02:00 committed by Dirk Hohndel
parent 51bc41b517
commit c9122283cc
4 changed files with 4 additions and 28 deletions

View file

@ -139,8 +139,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentTheme !== "Blue"
onClicked: {
blueTheme()
prefs.theme = subsurfaceTheme.currentTheme
manager.savePreferences()
PrefDisplay.theme = subsurfaceTheme.currentTheme
}
}
@ -192,8 +191,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentTheme !== "Pink"
onClicked: {
pinkTheme()
prefs.theme = subsurfaceTheme.currentTheme
manager.savePreferences()
PrefDisplay.theme = subsurfaceTheme.currentTheme
}
}
@ -244,8 +242,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentTheme !== "Dark"
onClicked: {
darkTheme()
prefs.theme = subsurfaceTheme.currentTheme
manager.savePreferences()
PrefDisplay.theme = subsurfaceTheme.currentTheme
}
}
}

View file

@ -506,7 +506,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*28)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*28))) : rootItem.width
Component.onCompleted: {
// this needs to pick the theme from persistent preference settings
var theme = prefs.theme
var theme = PrefDisplay.theme
if (theme == "Blue")
blueTheme()
else if (theme == "Pink")

View file

@ -108,19 +108,6 @@ void QMLPrefs::setShowPin(bool enable)
emit showPinChanged();
}
const QString QMLPrefs::theme() const
{
return qPrefDisplay::theme();
}
void QMLPrefs::setTheme(QString theme)
{
qPrefDisplay::set_theme(theme);
emit themeChanged();
}
/*** public slot functions ***/
void QMLPrefs::cancelCredentialsPinSetup()
{

View file

@ -33,10 +33,6 @@ class QMLPrefs : public QObject {
MEMBER m_oldStatus
WRITE setOldStatus
NOTIFY oldStatusChanged)
Q_PROPERTY(QString theme
READ theme
WRITE setTheme
NOTIFY themeChanged)
public:
QMLPrefs();
~QMLPrefs();
@ -61,9 +57,6 @@ public:
bool showPin() const;
void setShowPin(bool enable);
const QString theme() const;
void setTheme(QString theme);
public slots:
void cancelCredentialsPinSetup();
void clearCredentials();
@ -84,7 +77,6 @@ signals:
void credentialStatusChanged();
void oldStatusChanged();
void showPinChanged();
void themeChanged();
};
#endif