aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/GpsList.qml
diff options
context:
space:
mode:
authorGravatar Marco Martin <notmart@gmail.com>2016-03-08 21:26:54 +0100
committerGravatar Marco Martin <notmart@gmail.com>2016-03-08 21:26:54 +0100
commitc780cfd7ce483c5e3e870c9c92c06a4f1995cbed (patch)
tree80e1e3ae9d2c1342f2bfba1397637452f98efc28 /qt-mobile/qml/GpsList.qml
parentc6c3967dd99f198131f3f3e170a6d20d0dc77deb (diff)
downloadsubsurface-c780cfd7ce483c5e3e870c9c92c06a4f1995cbed.tar.gz
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 <notmart@gmail.com>
Diffstat (limited to 'qt-mobile/qml/GpsList.qml')
-rw-r--r--qt-mobile/qml/GpsList.qml73
1 files changed, 36 insertions, 37 deletions
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"
}
}
}