mobile-widgets: switch to new subsurfaceTheme

Remove subsurfaceTheme from main.qml
Replace ThemeNew -> subsurfaceTheme
change registration ThemeNew -> subsurfaceTheme

Signed-off-by: jan Iversen <jan@casacondor.com>
This commit is contained in:
jan Iversen 2020-01-15 09:40:54 +01:00 committed by Dirk Hohndel
parent 38120d555f
commit 35de9c49a4
5 changed files with 8 additions and 32 deletions

View file

@ -188,8 +188,8 @@ Kirigami.Page {
actions.main: Kirigami.Action {
icon {
name: state !== "view" ? ThemeNew.iconStyle + "/document-save.svg" :
ThemeNew.iconStyle + "/document-edit.svg"
name: state !== "view" ? subsurfaceTheme.iconStyle + "/document-save.svg" :
subsurfaceTheme.iconStyle + "/document-edit.svg"
color: subsurfaceTheme.primaryColor
}
text: state !== "view" ? qsTr("Save edits") : qsTr("Edit dive")

View file

@ -145,15 +145,15 @@ TemplatePage {
TemplateComboBox {
editable: false
Layout.columnSpan: 2
currentIndex: (ThemeNew.currentTheme === "Blue") ? 0 :
(ThemeNew.currentTheme === "Pink") ? 1 : 2
currentIndex: (subsurfaceTheme.currentTheme === "Blue") ? 0 :
(subsurfaceTheme.currentTheme === "Pink") ? 1 : 2
model: ListModel {
ListElement {text: qsTr("Blue")}
ListElement {text: qsTr("Pink")}
ListElement {text: qsTr("Dark")}
}
onActivated: {
ThemeNew.currentTheme = currentIndex === 0 ? "Blue" :
subsurfaceTheme.currentTheme = currentIndex === 0 ? "Blue" :
currentIndex === 1 ? "Pink" : "Dark"
}
}

View file

@ -69,7 +69,7 @@ Kirigami.Page {
text: "basePointSize:"
}
Controls.Label {
text: ThemeNew.basePointSize
text: subsurfaceTheme.basePointSize
}
Controls.Label {

View file

@ -563,7 +563,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
] // end actions
Image {
fillMode: Image.PreserveAspectFit
source: "qrc:///icons/" + (ThemeNew.currentTheme !== "" ? ThemeNew.currentTheme : "Blue") + "_gps.svg"
source: "qrc:///icons/" + (subsurfaceTheme.currentTheme !== "" ? subsurfaceTheme.currentTheme : "Blue") + "_gps.svg"
visible: locationServiceEnabled
}
}
@ -607,30 +607,6 @@ if you have network connectivity and want to sync your data to cloud storage."),
}
}
QtObject {
id: subsurfaceTheme
property double regularPointSize: ThemeNew.regularPointSize
property double titlePointSize: ThemeNew.titlePointSize
property double headingPointSize: ThemeNew.headingPointSize
property double smallPointSize: ThemeNew.smallPointSize
// colors currently in use
property color darkerPrimaryColor: ThemeNew.darkerPrimaryColor
property color darkerPrimaryTextColor: ThemeNew.darkerPrimaryTextColor
property color primaryColor: ThemeNew.primaryColor
property color primaryTextColor: ThemeNew.primaryTextColor
property color lightPrimaryColor: ThemeNew.lightPrimaryColor
property color lightPrimaryTextColor: ThemeNew.lightPrimaryTextColor
property color backgroundColor: ThemeNew.backgroundColor
property color textColor: ThemeNew.textColor
property color secondaryTextColor: ThemeNew.secondaryTextColor
property color drawerColor: ThemeNew.drawerColor
property color contrastAccentColor: ThemeNew.contrastAccentColor
property color lightDrawerColor: ThemeNew.lightDrawerColor
}
onWidthChanged: {
manager.appendTextToLog("Window width changed to " + width + " orientation " + Screen.primaryOrientation)
if (placeHolder.initialWidth !== undefined) {

View file

@ -74,7 +74,7 @@ themeInterface *themeInterface::instance()
void themeInterface::setup(QQmlContext *ct)
{
// Register interface class
ct->setContextProperty("ThemeNew", instance());
ct->setContextProperty("subsurfaceTheme", instance());
// get current theme
m_currentTheme = qPrefDisplay::theme();