Mobile QML: main.qml to Kirigmi 2.2

This is a long standing issue. I wish to keep up with Kirigami developments
including new versions of their controls, but this is not always easy.
While we upgraded to Kirigmi 2.2 for most of our QML earlier, using this
new version of main.qml breaks numerous stuff. In fact, so much that
we just needed to wait.

With the progress in Kirigmi, it is now possible to upgrade, with still
some issues on our side to be fixed, but this is manageble now.

The main show-stopper was a construct to set our theme colors, for example:
Kirigami.Theme.highlightColor = Qt.binding(...)
This is not posssible any more, as the Kirigami.Theme has made these
readonly on their end.

This commit just removes the assignments to the now readonly theme
items. And the setting of a correct theme color for the action button.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-11-19 19:27:45 +01:00
parent d5d830eac0
commit bd10a8442a
3 changed files with 3 additions and 12 deletions

View file

@ -176,6 +176,7 @@ Kirigami.Page {
actions.main: Kirigami.Action { actions.main: Kirigami.Action {
icon { icon {
name: state !== "view" ? "document-save" : "document-edit" name: state !== "view" ? "document-save" : "document-edit"
color: subsurfaceTheme.primaryColor
} }
onTriggered: { onTriggered: {
manager.appendTextToLog("save/edit button triggered") manager.appendTextToLog("save/edit button triggered")

View file

@ -333,6 +333,7 @@ Kirigami.ScrollablePage {
property QtObject downloadFromDCAction: Kirigami.Action { property QtObject downloadFromDCAction: Kirigami.Action {
icon { icon {
name: "downloadDC" name: "downloadDC"
color: subsurfaceTheme.primaryColor
} }
onTriggered: { onTriggered: {
downloadFromDc.dcImportModel.clearTable() downloadFromDc.dcImportModel.clearTable()

View file

@ -7,7 +7,7 @@ import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import org.subsurfacedivelog.mobile 1.0 import org.subsurfacedivelog.mobile 1.0
import org.kde.kirigami 2.0 as Kirigami import org.kde.kirigami 2.2 as Kirigami
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
id: rootItem id: rootItem
@ -443,17 +443,6 @@ 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 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: { Component.onCompleted: {
Kirigami.Theme.highlightColor = Qt.binding(function() { return primaryColor })
Kirigami.Theme.highlightedTextColor = Qt.binding(function() { return darkerPrimaryTextColor })
Kirigami.Theme.backgroundColor = Qt.binding(function() { return backgroundColor })
Kirigami.Theme.textColor = Qt.binding(function() { return textColor })
Kirigami.Theme.buttonHoverColor = Qt.binding(function() { return primaryColor })
Kirigami.Theme.viewBackgroundColor = Qt.binding(function() { return drawerColor })
Kirigami.Theme.viewTextColor = Qt.binding(function() { return textColor })
Kirigami.Theme.buttonBackgroundColor = Qt.binding(function() { return drawerColor })
Kirigami.Theme.buttonTextColor = Qt.binding(function() { return textColor })
Kirigami.Theme.buttonFocusColor = Qt.binding(function() { return "red" })
// this needs to pick the theme from persistent preference settings // this needs to pick the theme from persistent preference settings
var theme = manager.theme var theme = manager.theme
if (theme == "Blue") if (theme == "Blue")