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/GpsList.qml | 73 +++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 37 deletions(-) (limited to 'qt-mobile/qml/GpsList.qml') diff --git a/qt-mobile/qml/GpsList.qml b/qt-mobile/qml/GpsList.qml index 97998b3cf..0a57486c5 100644 --- a/qt-mobile/qml/GpsList.qml +++ b/qt-mobile/qml/GpsList.qml @@ -6,13 +6,14 @@ 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.Page { +Kirigami.ScrollablePage { id: gpsListWindow - width: parent.width - MobileComponents.Units.gridUnit - anchors.margins: MobileComponents.Units.gridUnit / 2 + width: parent.width - Kirigami.Units.gridUnit + anchors.margins: Kirigami.Units.gridUnit / 2 objectName: "gpsList" + title: "GPS Fixes" /* this can be done by hitting the back key contextualActions: [ @@ -28,15 +29,16 @@ MobileComponents.Page { */ Component { id: gpsDelegate - MobileComponents.ListItemWithActions { + Kirigami.ActionsForListItem { id: gpsFix enabled: true width: parent.width - property int horizontalPadding: MobileComponents.Units.gridUnit / 2 - MobileComponents.Units.smallSpacing + 1 + property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1 - Item { - width: parent.width - MobileComponents.Units.gridUnit - height: childrenRect.height - MobileComponents.Units.smallSpacing + Kirigami.BasicListItem { + supportsMouseEvents: true + width: parent.width - Kirigami.Units.gridUnit + height: childrenRect.height - Kirigami.Units.smallSpacing GridLayout { columns: 4 id: timeAndName @@ -46,55 +48,55 @@ MobileComponents.Page { right: parent.right rightMargin: horizontalPadding } - MobileComponents.Label { + Kirigami.Label { text: 'Date: ' opacity: 0.6 font.pointSize: subsurfaceTheme.smallPointSize } - MobileComponents.Label { + Kirigami.Label { text: date Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth) font.pointSize: subsurfaceTheme.smallPointSize } - MobileComponents.Label { + Kirigami.Label { text: 'Name: ' opacity: 0.6 font.pointSize: subsurfaceTheme.smallPointSize } - MobileComponents.Label { + Kirigami.Label { text: name Layout.preferredWidth: Math.max(parent.width / 5, paintedWidth) font.pointSize: subsurfaceTheme.smallPointSize } - MobileComponents.Label { + Kirigami.Label { text: 'Latitude: ' opacity: 0.6 font.pointSize: subsurfaceTheme.smallPointSize } - MobileComponents.Label { + Kirigami.Label { text: latitude font.pointSize: subsurfaceTheme.smallPointSize } - MobileComponents.Label { + Kirigami.Label { text: 'Longitude: ' opacity: 0.6 font.pointSize: subsurfaceTheme.smallPointSize } - MobileComponents.Label { + Kirigami.Label { text: longitude font.pointSize: subsurfaceTheme.smallPointSize } } } actions: [ - Action { + Kirigami.Action { iconName: "trash-empty" onTriggered: { print("delete this!") manager.deleteGpsFix(when) } }, - Action { + Kirigami.Action { iconName: "gps" onTriggered: { print("show map") @@ -106,25 +108,22 @@ MobileComponents.Page { } } - ScrollView { + ListView { + id: gpsListView anchors.fill: parent - ListView { - id: gpsListView - anchors.fill: parent - model: gpsModel - currentIndex: -1 - delegate: gpsDelegate - boundsBehavior: Flickable.StopAtBounds - maximumFlickVelocity: parent.height * 5 - cacheBuffer: Math.max(5000, parent.height * 5) - focus: true - clip: true - header: MobileComponents.Heading { - x: MobileComponents.Units.gridUnit / 2 - height: paintedHeight + MobileComponents.Units.gridUnit / 2 - verticalAlignment: Text.AlignBottom - text: "List of stored GPS fixes" - } + model: gpsModel + currentIndex: -1 + delegate: gpsDelegate + boundsBehavior: Flickable.StopAtBounds + maximumFlickVelocity: parent.height * 5 + cacheBuffer: Math.max(5000, parent.height * 5) + focus: true + clip: true + header: Kirigami.Heading { + x: Kirigami.Units.gridUnit / 2 + height: paintedHeight + Kirigami.Units.gridUnit / 2 + verticalAlignment: Text.AlignBottom + text: "List of stored GPS fixes" } } } -- cgit v1.2.3-70-g09d2