mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'kirigamiPort' of https://github.com/sebasje/subsurface into mergeKirigamiPort
This merge was a bit more challenging given how far things had diverged, but I hope I got it mostly right. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
commit
2efa047999
17 changed files with 436 additions and 423 deletions
|
|
@ -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.SwipeListItem {
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue