From c780cfd7ce483c5e3e870c9c92c06a4f1995cbed Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 8 Mar 2016 21:26:54 +0100 Subject: port to Kirigami imports and new api first quick and dirty port of the imports to Kirigami 1.0 (using system installed for now) adapt to api changes and try out some of the proposed ui changes from the HIG Signed-off-by: Marco Martin --- qt-mobile/qml/main.qml | 59 ++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'qt-mobile/qml/main.qml') diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index 1b7958f24..675dad623 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -6,9 +6,9 @@ import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 import org.subsurfacedivelog.mobile 1.0 -import org.kde.plasma.mobilecomponents 0.2 as MobileComponents +import org.kde.kirigami 1.0 as Kirigami -MobileComponents.ApplicationWindow { +Kirigami.ApplicationWindow { id: rootItem title: qsTr("Subsurface-mobile") property bool fullscreen: true @@ -37,20 +37,20 @@ MobileComponents.ApplicationWindow { detailsWindow.endEditMode() } - globalDrawer: MobileComponents.GlobalDrawer { + globalDrawer: Kirigami.GlobalDrawer { title: "Subsurface" titleIcon: "qrc:/qml/subsurface-mobile-icon.png" bannerImageSource: "dive.jpg" actions: [ - Action { + Kirigami.Action { text: "Dive list" onTriggered: { returnTopPage() globalDrawer.close() } }, - Action { + Kirigami.Action { text: "Cloud credentials" onTriggered: { returnTopPage() @@ -64,7 +64,7 @@ MobileComponents.ApplicationWindow { manager.credentialStatus = QMLManager.UNKNOWN } }, - MobileComponents.ActionGroup { + Kirigami.Action { text: "Manage dives" enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL /* @@ -77,7 +77,7 @@ MobileComponents.ApplicationWindow { } } */ - Action { + Kirigami.Action { text: "Add dive manually" onTriggered: { detailsWindow.state = "add" @@ -100,7 +100,7 @@ MobileComponents.ApplicationWindow { stackView.push(detailsWindow) } } - Action { + Kirigami.Action { text: "Refresh" onTriggered: { detailsWindow.endEditMode() @@ -116,31 +116,31 @@ MobileComponents.ApplicationWindow { } }, - MobileComponents.ActionGroup { + Kirigami.Action { text: "GPS" enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL - Action { + Kirigami.Action { text: "GPS-tag dives" onTriggered: { manager.applyGpsData(); } } - Action { + Kirigami.Action { text: "Upload GPS data" onTriggered: { manager.sendGpsData(); } } - Action { + Kirigami.Action { text: "Download GPS data" onTriggered: { manager.downloadGpsData(); } } - Action { + Kirigami.Action { text: "Show GPS fixes" onTriggered: { manager.populateGpsData(); @@ -148,13 +148,13 @@ MobileComponents.ApplicationWindow { } } - Action { + Kirigami.Action { text: "Clear GPS cache" onTriggered: { manager.clearGpsData(); } } - Action { + Kirigami.Action { text: "Preferences" onTriggered: { stackView.push(prefsWindow) @@ -163,22 +163,22 @@ MobileComponents.ApplicationWindow { } }, - MobileComponents.ActionGroup { + Kirigami.Action { text: "Developer" - Action { + Kirigami.Action { text: "App log" onTriggered: { stackView.push(logWindow) } } - Action { + Kirigami.Action { text: "Theme information" onTriggered: { stackView.push(themetest) } } - Action { + Kirigami.Action { checkable: true checked: manager.verboseEnabled text: checked ? "Disable verbose (for adb logcat)" : "Enable verbose (for adb logcat)" @@ -187,7 +187,7 @@ MobileComponents.ApplicationWindow { } } }, - Action { + Kirigami.Action { text: "About" onTriggered: { stackView.push(aboutWindow) @@ -198,7 +198,7 @@ MobileComponents.ApplicationWindow { MouseArea { height: childrenRect.height - width: MobileComponents.Units.gridUnit * 10 + width: Kirigami.Units.gridUnit * 10 CheckBox { //text: "Run location service" id: locationCheckbox @@ -211,8 +211,8 @@ MobileComponents.ApplicationWindow { manager.locationServiceEnabled = checked; } } - MobileComponents.Label { - x: MobileComponents.Units.gridUnit * 1.5 + Kirigami.Label { + x: Kirigami.Units.gridUnit * 1.5 anchors { left: locationCheckbox.right //leftMargin: units.smallSpacing @@ -227,7 +227,7 @@ MobileComponents.ApplicationWindow { } } - contextDrawer: MobileComponents.ContextDrawer { + contextDrawer: Kirigami.ContextDrawer { id: contextDrawer actions: rootItem.pageStack.currentPage ? rootItem.pageStack.currentPage.contextualActions : null title: "Actions" @@ -240,16 +240,11 @@ MobileComponents.ApplicationWindow { property color accentColor: "#2d5b9a" property color shadedColor: "#132744" property color accentTextColor: "#ececec" - property int columnWidth: Math.round(rootItem.width/(MobileComponents.Units.gridUnit*30)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(MobileComponents.Units.gridUnit*30))) : rootItem.width - } - - toolBar: TopBar { - width: parent.width - height: Layout.minimumHeight + property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*30)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*30))) : rootItem.width } property Item stackView: pageStack - initialPage: DiveList { + pageStack.initialPage: DiveList { anchors.fill: detailsPage id: diveList opacity: 0 @@ -295,6 +290,7 @@ MobileComponents.ApplicationWindow { GpsList { id: gpsWindow + visible: false } ThemeTest { @@ -303,6 +299,7 @@ MobileComponents.ApplicationWindow { } Component.onCompleted: { + Kirigami.Theme.highlightColor = subsurfaceTheme.accentColor manager.finishSetup(); rootItem.visible = true diveList.opacity = 1 -- cgit v1.2.3-70-g09d2 From 74f8d502648c6c6a20c1d2f66a1880079ceafad9 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 1 Apr 2016 16:54:22 -0500 Subject: QML UI: use the new Kirigami option to control the title bar sizes I liked the default and the fact that it disappeared completely, but the big size was a bit too much... Signed-off-by: Dirk Hohndel --- qt-mobile/qml/main.qml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-mobile/qml/main.qml') diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index 150e9769f..6b2786561 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -11,6 +11,10 @@ import org.kde.kirigami 1.0 as Kirigami Kirigami.ApplicationWindow { id: rootItem title: qsTr("Subsurface-mobile") + + header.minimumHeight: 0 + header.preferredHeight: Kirigami.Units.gridUnit + header.maximumHeight: Kirigami.Units.gridUnit * 2 property bool fullscreen: true property int oldStatus: -1 property alias accessingCloud: manager.accessingCloud -- cgit v1.2.3-70-g09d2 From c117a7be6ef9a07974235439f39b320a203d9df4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 1 Apr 2016 16:55:24 -0500 Subject: QML UI: make the dive list font even darker Still not black, though - there's an opacity setting somewhere that I must be missing. Signed-off-by: Dirk Hohndel --- qt-mobile/qml/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-mobile/qml/main.qml') diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index 6b2786561..0b8e24adc 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -257,7 +257,7 @@ Kirigami.ApplicationWindow { property color accentColor: "#2d5b9a" property color shadedColor: "#132744" property color accentTextColor: "#ececec" - property color diveListTextColor: Qt.rgba(0,0,0,0.76) // the Kirigami theme text color is too light + property color diveListTextColor: "#000000" // the Kirigami theme text color is too light property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*30)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*30))) : rootItem.width } /* -- cgit v1.2.3-70-g09d2