aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/TripDetails.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-21 21:32:40 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-10 09:25:57 -0700
commit4b4df28ecdd528c3ad74b95b6ab00a29f24d256a (patch)
tree57bc766dff682a648239328150004624ae0a21e7 /mobile-widgets/qml/TripDetails.qml
parent028807ebc5085652c53f75c1419e9cca988cd0a9 (diff)
downloadsubsurface-4b4df28ecdd528c3ad74b95b6ab00a29f24d256a.tar.gz
mobile UI: add divelist context drawer action to edit trip details
For now this only shows the trip details. They can be edited on the page, but there is no way to save those edits, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/TripDetails.qml')
-rw-r--r--mobile-widgets/qml/TripDetails.qml66
1 files changed, 66 insertions, 0 deletions
diff --git a/mobile-widgets/qml/TripDetails.qml b/mobile-widgets/qml/TripDetails.qml
new file mode 100644
index 000000000..7f0a69be0
--- /dev/null
+++ b/mobile-widgets/qml/TripDetails.qml
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0
+import QtQuick 2.6
+import QtQuick.Controls 2.2 as Controls
+import QtQuick.Layouts 1.2
+import org.subsurfacedivelog.mobile 1.0
+import org.kde.kirigami 2.4 as Kirigami
+
+Kirigami.Page {
+ id: tripEditPage
+ objectName: "TripDetails"
+ property string tripLocation
+ property string tripNotes
+
+ title: "" !== tripLocation ? tripLocation : qsTr("Trip details")
+ state: "view"
+ padding: Kirigami.largeSpacing
+ background: Rectangle { color: subsurfaceTheme.backgroundColor }
+ width: rootItem.colWidth
+ Flickable {
+ id: tripEditFlickable
+ anchors.fill: parent
+ GridLayout {
+ columns: 2
+ width: tripEditFlickable.width
+ TemplateLabel {
+ Layout.columnSpan: 2
+ id: title
+ text: qsTr("Edit trip details")
+ font.pointSize: subsurfaceTheme.titlePointSize
+ font.bold: true
+ }
+ Rectangle {
+ id: spacer
+ Layout.columnSpan: 2
+ color: subsurfaceTheme.backgroundColor
+ height: Kirigami.Units.gridUnit
+ width: 1
+ }
+
+ TemplateLabel {
+ text: qsTr("Trip location:")
+ opacity: 0.6
+ }
+ SsrfTextField {
+ Layout.fillWidth: true
+ text: tripLocation
+ flickable: tripEditFlickable
+ }
+ TemplateLabel {
+ Layout.columnSpan: 2
+ text: qsTr("Trip notes")
+ opacity: 0.6
+ }
+ Controls.TextArea {
+ text: tripNotes
+ textFormat: TextEdit.RichText
+ Layout.columnSpan: 2
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.minimumHeight: Kirigami.Units.gridUnit * 6
+ selectByMouse: true
+ wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
+ }
+ }
+ }
+}