mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Merge branch 'mergeKirigamiPort'
This commit is contained in:
commit
3aa219c689
17 changed files with 467 additions and 437 deletions
|
@ -1,60 +1,59 @@
|
|||
import QtQuick 2.3
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
|
||||
MobileComponents.Page {
|
||||
Kirigami.ScrollablePage {
|
||||
id: aboutPage
|
||||
property int pageWidth: subsurfaceTheme.columnWidth - MobileComponents.Units.smallSpacing
|
||||
property int pageWidth: subsurfaceTheme.columnWidth - Kirigami.Units.smallSpacing
|
||||
title: "About Subsurface-mobile"
|
||||
|
||||
ScrollView {
|
||||
anchors.fill: parent
|
||||
ColumnLayout {
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
width: aboutPage.width
|
||||
Layout.margins: Kirigami.Units.gridUnit / 2
|
||||
|
||||
ColumnLayout {
|
||||
spacing: MobileComponents.Units.largeSpacing
|
||||
width: aboutPage.width
|
||||
Layout.margins: MobileComponents.Units.gridUnit / 2
|
||||
|
||||
MobileComponents.Heading {
|
||||
text: "About Subsurface-mobile"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.maximumWidth: pageWidth
|
||||
Layout.topMargin: MobileComponents.Units.gridUnit
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
Image {
|
||||
id: image
|
||||
source: "qrc:/qml/subsurface-mobile-icon.png"
|
||||
width: pageWidth / 2
|
||||
height: width
|
||||
fillMode: Image.Stretch
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
horizontalAlignment: Image.AlignHCenter
|
||||
}
|
||||
MobileComponents.Heading {
|
||||
text: "A mobile version of the free Subsurface divelog software.\n" +
|
||||
"View your dive logs while on the go."
|
||||
level: 4
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: MobileComponents.Units.largeSpacing * 3
|
||||
Layout.maximumWidth: pageWidth
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
anchors.horizontalCenter: parent.Center
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
Kirigami.Heading {
|
||||
text: "About Subsurface-mobile"
|
||||
Layout.topMargin: Kirigami.Units.gridUnit
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.maximumWidth: pageWidth
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
Image {
|
||||
id: image
|
||||
source: "qrc:/qml/subsurface-mobile-icon.png"
|
||||
width: pageWidth / 2
|
||||
height: width
|
||||
fillMode: Image.Stretch
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
horizontalAlignment: Image.AlignHCenter
|
||||
}
|
||||
|
||||
MobileComponents.Heading {
|
||||
text: "Version: " + manager.getVersion() + "\n\n© Subsurface developer team\n2011-2016"
|
||||
level: 5
|
||||
font.pointSize: subsurfaceTheme.smallPointSize + 1
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: MobileComponents.Units.largeSpacing
|
||||
Layout.maximumWidth: pageWidth
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
anchors.horizontalCenter: parent.Center
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
Kirigami.Heading {
|
||||
text: "A mobile version of the free Subsurface divelog software.\n" +
|
||||
"View your dive logs while on the go."
|
||||
level: 4
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing * 3
|
||||
Layout.maximumWidth: pageWidth
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
anchors.horizontalCenter: parent.Center
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
||||
Kirigami.Heading {
|
||||
text: "Version: " + manager.getVersion() + "\n\n© Subsurface developer team\n2011-2016"
|
||||
level: 5
|
||||
font.pointSize: subsurfaceTheme.smallPointSize + 1
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
Layout.maximumWidth: pageWidth
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
anchors.horizontalCenter: parent.Center
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ import QtQuick.Controls 1.2
|
|||
import QtQuick.Window 2.2
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
|
||||
Item {
|
||||
id: loginWindow
|
||||
height: outerLayout.height + 2 * MobileComponents.Units.gridUnit
|
||||
height: outerLayout.height + 2 * Kirigami.Units.gridUnit
|
||||
|
||||
property string username: login.text;
|
||||
property string password: password.text;
|
||||
|
@ -21,10 +21,10 @@ Item {
|
|||
|
||||
ColumnLayout {
|
||||
id: outerLayout
|
||||
width: subsurfaceTheme.columnWidth - 2 * MobileComponents.Units.gridUnit
|
||||
width: subsurfaceTheme.columnWidth - 2 * Kirigami.Units.gridUnit
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
if (visible && !manager.accessingCloud) {
|
||||
manager.appendTextToLog("Credential scrn: show kbd was: " + (Qt.inputMethod.isVisible ? "visible" : "invisible"))
|
||||
Qt.inputMethod.show()
|
||||
login.forceActiveFocus()
|
||||
|
@ -34,13 +34,13 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
text: "Cloud credentials"
|
||||
level: headingLevel
|
||||
Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
|
||||
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Email"
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ Item {
|
|||
Qt.ImhNoAutoUppercase
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Password"
|
||||
}
|
||||
|
||||
|
@ -75,10 +75,10 @@ Item {
|
|||
password.echoMode = checked ? TextInput.Normal : TextInput.Password
|
||||
}
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Show password"
|
||||
}
|
||||
}
|
||||
Item { width: MobileComponents.Units.gridUnit; height: width }
|
||||
Item { width: Kirigami.Units.gridUnit; height: width }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ import QtQuick.Controls.Styles 1.4
|
|||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.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.Page {
|
||||
id: diveDetailsPage
|
||||
property alias currentIndex: diveDetailsListView.currentIndex
|
||||
property alias dive_id: detailsEdit.dive_id
|
||||
|
@ -26,25 +26,29 @@ MobileComponents.Page {
|
|||
property alias endpressure: detailsEdit.endpressureText
|
||||
property alias gasmix: detailsEdit.gasmixText
|
||||
|
||||
topPadding: applicationWindow().header.Layout.preferredHeight
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
title: diveDetailsListView.currentItem.modelData.dive.location
|
||||
state: "view"
|
||||
flickable: diveDetailsListView.currentItem
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "view"
|
||||
PropertyChanges { target: diveDetailsPage; contextualActions: Qt.platform.os == "ios" ? [ deleteAction, backAction ] : [ deleteAction ] }
|
||||
PropertyChanges { target: diveDetailList; visible: true }
|
||||
PropertyChanges { target: detailsEditScroll; visible: false }
|
||||
},
|
||||
State {
|
||||
name: "edit"
|
||||
PropertyChanges { target: diveDetailsPage; contextualActions: Qt.platform.os == "ios" ? [ cancelAction ] : null }
|
||||
PropertyChanges { target: diveDetailList; visible: false }
|
||||
PropertyChanges { target: detailsEditScroll; visible: true }
|
||||
},
|
||||
State {
|
||||
name: "add"
|
||||
PropertyChanges { target: diveDetailsPage; contextualActions: Qt.platform.os == "ios" ? [ cancelAction ] : null }
|
||||
PropertyChanges { target: diveDetailList; visible: false }
|
||||
PropertyChanges { target: detailsEditScroll; visible: true }
|
||||
}
|
||||
|
||||
|
@ -65,7 +69,7 @@ MobileComponents.Page {
|
|||
}
|
||||
}
|
||||
|
||||
property QtObject cancelAction: Action {
|
||||
property QtObject cancelAction: Kirigami.Action {
|
||||
text: state === "edit" ? "Cancel edit" : "Cancel dive add"
|
||||
iconName: "dialog-cancel"
|
||||
onTriggered: {
|
||||
|
@ -161,50 +165,53 @@ MobileComponents.Page {
|
|||
|
||||
onWidthChanged: diveDetailsListView.positionViewAtIndex(diveDetailsListView.currentIndex, ListView.Beginning);
|
||||
|
||||
ScrollView {
|
||||
id: diveDetailList
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
ListView {
|
||||
id: diveDetailsListView
|
||||
ScrollView {
|
||||
id: diveDetailList
|
||||
anchors.fill: parent
|
||||
model: diveModel
|
||||
currentIndex: -1
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
maximumFlickVelocity: parent.width * 5
|
||||
orientation: ListView.Horizontal
|
||||
focus: true
|
||||
clip: true
|
||||
snapMode: ListView.SnapOneItem
|
||||
onMovementEnded: {
|
||||
currentIndex = indexAt(contentX+1, 1);
|
||||
}
|
||||
delegate: ScrollView {
|
||||
id: internalScrollView
|
||||
width: diveDetailsListView.width
|
||||
height: diveDetailsListView.height
|
||||
property var modelData: model
|
||||
Flickable {
|
||||
//contentWidth: parent.width
|
||||
contentHeight: diveDetails.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
DiveDetailsView {
|
||||
id: diveDetails
|
||||
width: internalScrollView.width
|
||||
ListView {
|
||||
id: diveDetailsListView
|
||||
anchors.fill: parent
|
||||
model: diveModel
|
||||
currentIndex: -1
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
maximumFlickVelocity: parent.width * 5
|
||||
orientation: ListView.Horizontal
|
||||
focus: true
|
||||
clip: true
|
||||
snapMode: ListView.SnapOneItem
|
||||
onMovementEnded: {
|
||||
currentIndex = indexAt(contentX+1, 1);
|
||||
}
|
||||
delegate: ScrollView {
|
||||
id: internalScrollView
|
||||
width: diveDetailsListView.width
|
||||
height: diveDetailsListView.height
|
||||
property var modelData: model
|
||||
Flickable {
|
||||
//contentWidth: parent.width
|
||||
contentHeight: diveDetails.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
DiveDetailsView {
|
||||
id: diveDetails
|
||||
width: internalScrollView.width
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Flickable {
|
||||
id: detailsEditScroll
|
||||
anchors.fill: parent
|
||||
anchors.margins: MobileComponents.Units.gridUnit
|
||||
contentWidth: contentItem.childrenRect.width;
|
||||
contentHeight: contentItem.childrenRect.height
|
||||
clip: true
|
||||
bottomMargin: MobileComponents.Units.gridUnit * 3
|
||||
DiveDetailsEdit {
|
||||
id: detailsEdit
|
||||
Kirigami.OverlaySheet {
|
||||
id: detailsEditScroll
|
||||
anchors.fill: parent
|
||||
onOpenedChanged: {
|
||||
if (!opened) {
|
||||
diveDetailsPage.state = "view"
|
||||
}
|
||||
}
|
||||
DiveDetailsEdit {
|
||||
id: detailsEdit
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import QtQuick.Controls.Styles 1.2
|
|||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
|
||||
Item {
|
||||
id: detailsEdit
|
||||
|
@ -59,19 +59,19 @@ Item {
|
|||
height: editArea.height
|
||||
ColumnLayout {
|
||||
id: editArea
|
||||
spacing: MobileComponents.Units.smallSpacing
|
||||
width: subsurfaceTheme.columnWidth - 2 * MobileComponents.Units.gridUnit
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
width: subsurfaceTheme.columnWidth - 2 * Kirigami.Units.gridUnit
|
||||
|
||||
GridLayout {
|
||||
id: editorDetails
|
||||
width: parent.width
|
||||
columns: 2
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
Layout.columnSpan: 2
|
||||
text: "Dive " + number
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Date:"
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ Item {
|
|||
id: txtDate;
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Location:"
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ Item {
|
|||
// to add the current location as the dive location
|
||||
// (think of someone adding a dive while on the boat or
|
||||
// at the dive site)
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Use current\nGPS location:"
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Depth:"
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
validator: RegExpValidator { regExp: /[^-]*/ }
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Duration:"
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ Item {
|
|||
validator: RegExpValidator { regExp: /[^-]*/ }
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Air Temp:"
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Water Temp:"
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Suit:"
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Buddy:"
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Dive Master:"
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Weight:"
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Gas mix:"
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ Item {
|
|||
validator: RegExpValidator { regExp: /(EAN100|EAN\d\d|AIR|100|\d{1,2}|\d{1,2}\/\d{1,2})/ }
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "Start Pressure:"
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
text: "End Pressure:"
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ Item {
|
|||
}
|
||||
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.columnSpan: 2
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
text: "Notes:"
|
||||
|
@ -223,13 +223,13 @@ Item {
|
|||
focus: true
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumHeight: MobileComponents.Units.gridUnit * 6
|
||||
Layout.minimumHeight: Kirigami.Units.gridUnit * 6
|
||||
selectByMouse: true
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
}
|
||||
Item {
|
||||
height: MobileComponents.Units.gridUnit * 3
|
||||
height: Kirigami.Units.gridUnit * 3
|
||||
width: height // just to make sure the spacer doesn't produce scrollbars, but also isn't null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,23 +7,23 @@ import QtQuick.Controls.Styles 1.2
|
|||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
|
||||
Item {
|
||||
id: detailsView
|
||||
property real gridWidth: subsurfaceTheme.columnWidth - 2 * MobileComponents.Units.gridUnit
|
||||
property real gridWidth: subsurfaceTheme.columnWidth - 2 * Kirigami.Units.gridUnit
|
||||
property real col1Width: gridWidth * 0.23
|
||||
property real col2Width: gridWidth * 0.37
|
||||
property real col3Width: gridWidth * 0.20
|
||||
property real col4Width: gridWidth * 0.20
|
||||
|
||||
width: SubsurfaceTheme.columnWidth
|
||||
height: mainLayout.implicitHeight + bottomLayout.implicitHeight + MobileComponents.Units.iconSizes.large
|
||||
height: mainLayout.implicitHeight + bottomLayout.implicitHeight + Kirigami.Units.iconSizes.large
|
||||
Rectangle {
|
||||
z: 99
|
||||
color: MobileComponents.Theme.textColor
|
||||
color: Kirigami.Theme.textColor
|
||||
opacity: 0.3
|
||||
width: MobileComponents.Units.smallSpacing/4
|
||||
width: Kirigami.Units.smallSpacing/4
|
||||
anchors {
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
|
@ -36,13 +36,13 @@ Item {
|
|||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: Math.round(MobileComponents.Units.gridUnit / 2)
|
||||
margins: Math.round(Kirigami.Units.gridUnit / 2)
|
||||
}
|
||||
columns: 4
|
||||
rowSpacing: MobileComponents.Units.smallSpacing * 2
|
||||
columnSpacing: MobileComponents.Units.smallSpacing
|
||||
rowSpacing: Kirigami.Units.smallSpacing * 2
|
||||
columnSpacing: Kirigami.Units.smallSpacing
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
id: detailsViewHeading
|
||||
Layout.fillWidth: true
|
||||
text: dive.location
|
||||
|
@ -57,41 +57,41 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: dateLabel
|
||||
text: "Date: "
|
||||
opacity: 0.6
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: dive.date + " " + dive.time
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
Layout.columnSpan: 2
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: numberText
|
||||
text: "#" + dive.number
|
||||
color: MobileComponents.Theme.textColor
|
||||
color: Kirigami.Theme.textColor
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: depthLabel
|
||||
text: "Depth: "
|
||||
opacity: 0.6
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: dive.depth
|
||||
Layout.fillWidth: true
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Duration: "
|
||||
opacity: 0.6
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: dive.duration
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
|
@ -108,16 +108,16 @@ Item {
|
|||
color: "transparent"
|
||||
opacity: 0.6
|
||||
border.width: 1
|
||||
border.color: MobileComponents.Theme.textColor;
|
||||
border.color: Kirigami.Theme.textColor;
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: noProfile
|
||||
visible: dive.noDive
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 4
|
||||
Layout.margins: MobileComponents.Units.gridUnit
|
||||
Layout.margins: Kirigami.Units.gridUnit
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "No profile to show"
|
||||
}
|
||||
|
@ -128,13 +128,13 @@ Item {
|
|||
top: mainLayout.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: Math.round(MobileComponents.Units.gridUnit / 2)
|
||||
margins: Math.round(Kirigami.Units.gridUnit / 2)
|
||||
}
|
||||
columns: 4
|
||||
rowSpacing: MobileComponents.Units.smallSpacing * 2
|
||||
columnSpacing: MobileComponents.Units.smallSpacing
|
||||
rowSpacing: Kirigami.Units.smallSpacing * 2
|
||||
columnSpacing: Kirigami.Units.smallSpacing
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
Layout.fillWidth: true
|
||||
level: 3
|
||||
text: "Dive Details"
|
||||
|
@ -142,7 +142,7 @@ Item {
|
|||
}
|
||||
|
||||
// first row - here we set up the column widths - total is 90% of width
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Suit:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -150,7 +150,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col1Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtSuit
|
||||
text: dive.suit
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -158,7 +158,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col2Width
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Air Temp:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -166,7 +166,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col3Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtAirTemp
|
||||
text: dive.airTemp
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -174,7 +174,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col4Width
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Cylinder:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -182,7 +182,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col1Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtCylinder
|
||||
text: dive.getCylinder
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -190,7 +190,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col2Width
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Water Temp:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -198,7 +198,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col3Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtWaterTemp
|
||||
text: dive.waterTemp
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -206,7 +206,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col4Width
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Dive Master:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -214,7 +214,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col1Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtDiveMaster
|
||||
text: dive.divemaster
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -222,7 +222,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col2Width
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Weight:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -230,7 +230,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col3Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtWeight
|
||||
text: dive.sumWeight
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -238,7 +238,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col4Width
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Buddy:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -246,7 +246,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col1Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtBuddy
|
||||
text: dive.buddy
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -254,7 +254,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col2Width
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "SAC:"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
opacity: 0.6
|
||||
|
@ -262,7 +262,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col3Width
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtSAC
|
||||
text: dive.sac
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -270,7 +270,7 @@ Item {
|
|||
Layout.preferredWidth: detailsView.col4Width
|
||||
}
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
Layout.fillWidth: true
|
||||
level: 3
|
||||
text: "Notes"
|
||||
|
@ -278,7 +278,7 @@ Item {
|
|||
Layout.columnSpan: 4
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: txtNotes
|
||||
text: dive.notes
|
||||
focus: true
|
||||
|
@ -291,10 +291,10 @@ Item {
|
|||
Item {
|
||||
Layout.columnSpan: 4
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumHeight: MobileComponents.Units.gridUnit * 3
|
||||
Layout.minimumHeight: Kirigami.Units.gridUnit * 3
|
||||
}
|
||||
Component.onCompleted: {
|
||||
qmlProfile.setMargin(MobileComponents.Units.smallSpacing)
|
||||
qmlProfile.setMargin(Kirigami.Units.smallSpacing)
|
||||
qmlProfile.diveId = model.dive.id;
|
||||
qmlProfile.update();
|
||||
}
|
||||
|
|
|
@ -3,13 +3,16 @@ import QtQuick.Controls 1.2
|
|||
import QtQuick.Layouts 1.2
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Dialogs 1.2
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
|
||||
MobileComponents.Page {
|
||||
Kirigami.ScrollablePage {
|
||||
id: page
|
||||
objectName: "DiveList"
|
||||
color: MobileComponents.Theme.viewBackgroundColor
|
||||
title: "Subsurface-mobile"
|
||||
background: Rectangle {
|
||||
color: Kirigami.Theme.viewBackgroundColor
|
||||
}
|
||||
|
||||
property int credentialStatus: manager.credentialStatus
|
||||
property int numDives: diveListView.count
|
||||
|
@ -21,13 +24,14 @@ MobileComponents.Page {
|
|||
|
||||
Component {
|
||||
id: diveDelegate
|
||||
MobileComponents.ListItem {
|
||||
Kirigami.AbstractListItem {
|
||||
enabled: true
|
||||
supportsMouseEvents: true
|
||||
checked: diveListView.currentIndex === model.index
|
||||
width: parent.width
|
||||
|
||||
property real detailsOpacity : 0
|
||||
property int horizontalPadding: MobileComponents.Units.gridUnit / 2 - MobileComponents.Units.smallSpacing + 1
|
||||
property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1
|
||||
|
||||
// When clicked, the mode changes to details view
|
||||
onClicked: {
|
||||
|
@ -39,10 +43,10 @@ MobileComponents.Page {
|
|||
}
|
||||
|
||||
Item {
|
||||
width: parent.width - MobileComponents.Units.gridUnit
|
||||
height: childrenRect.height - MobileComponents.Units.smallSpacing
|
||||
width: parent.width - Kirigami.Units.gridUnit
|
||||
height: childrenRect.height - Kirigami.Units.smallSpacing
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: locationText
|
||||
text: dive.location
|
||||
font.weight: Font.Light
|
||||
|
@ -56,7 +60,7 @@ MobileComponents.Page {
|
|||
right: dateLabel.left
|
||||
}
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: dateLabel
|
||||
text: dive.date + " " + dive.time
|
||||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
|
@ -72,31 +76,32 @@ MobileComponents.Page {
|
|||
leftMargin: horizontalPadding
|
||||
right: parent.right
|
||||
rightMargin: horizontalPadding
|
||||
topMargin: - Kirigami.Units.smallSpacing * 2
|
||||
bottom: numberText.bottom
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: 'Depth: '
|
||||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
color: textColor
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: dive.depth
|
||||
width: Math.max(MobileComponents.Units.gridUnit * 3, paintedWidth) // helps vertical alignment throughout listview
|
||||
width: Math.max(Kirigami.Units.gridUnit * 3, paintedWidth) // helps vertical alignment throughout listview
|
||||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
color: textColor
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: 'Duration: '
|
||||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
color: textColor
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: dive.duration
|
||||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
color: textColor
|
||||
}
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: numberText
|
||||
text: "#" + dive.number
|
||||
font.pointSize: subsurfaceTheme.smallPointSize
|
||||
|
@ -104,6 +109,7 @@ MobileComponents.Page {
|
|||
anchors {
|
||||
right: parent.right
|
||||
top: locationText.bottom
|
||||
topMargin: - Kirigami.Units.smallSpacing * 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -113,10 +119,10 @@ MobileComponents.Page {
|
|||
Component {
|
||||
id: tripHeading
|
||||
Item {
|
||||
width: page.width - MobileComponents.Units.gridUnit
|
||||
height: childrenRect.height + MobileComponents.Units.smallSpacing * 2 + Math.max(2, MobileComponents.Units.gridUnit / 2)
|
||||
width: page.width - Kirigami.Units.gridUnit
|
||||
height: childrenRect.height + Kirigami.Units.smallSpacing * 2 + Math.max(2, Kirigami.Units.gridUnit / 2)
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
id: sectionText
|
||||
text: {
|
||||
// if the tripMeta (which we get as "section") ends in ::-- we know
|
||||
|
@ -134,20 +140,20 @@ MobileComponents.Page {
|
|||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
topMargin: Math.max(2, MobileComponents.Units.gridUnit / 2)
|
||||
leftMargin: MobileComponents.Units.gridUnit / 2
|
||||
topMargin: Math.max(2, Kirigami.Units.gridUnit / 2)
|
||||
leftMargin: Kirigami.Units.gridUnit / 2
|
||||
right: parent.right
|
||||
}
|
||||
color: textColor
|
||||
level: 2
|
||||
}
|
||||
Rectangle {
|
||||
height: Math.max(2, MobileComponents.Units.gridUnit / 12) // we want a thicker line
|
||||
height: Math.max(2, Kirigami.Units.gridUnit / 12) // we want a thicker line
|
||||
anchors {
|
||||
top: sectionText.bottom
|
||||
left: parent.left
|
||||
leftMargin: MobileComponents.Units.gridUnit * -2
|
||||
rightMargin: MobileComponents.Units.gridUnit * -2
|
||||
leftMargin: Kirigami.Units.gridUnit * -2
|
||||
rightMargin: Kirigami.Units.gridUnit * -2
|
||||
right: parent.right
|
||||
}
|
||||
color: subsurfaceTheme.accentColor
|
||||
|
@ -155,46 +161,60 @@ MobileComponents.Page {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: stackView
|
||||
onDepthChanged: {
|
||||
if (stackView.depth === 1) {
|
||||
diveListView.currentIndex = -1;
|
||||
ScrollView {
|
||||
id: startPageWrapper
|
||||
anchors.fill: parent
|
||||
opacity: (diveListView.count > 0 && (credentialStatus == QMLManager.VALID || credentialStatus == QMLManager.VALID_EMAIL)) ? 0 : 1
|
||||
visible: opacity > 0
|
||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } }
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
page.mainAction = page.saveAction
|
||||
} else {
|
||||
page.mainAction = null
|
||||
}
|
||||
}
|
||||
|
||||
StartPage {
|
||||
id: startPage
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: diveListView
|
||||
anchors.fill: parent
|
||||
opacity: 0.8 - startPageWrapper.opacity
|
||||
visible: opacity > 0
|
||||
model: diveModel
|
||||
currentIndex: -1
|
||||
delegate: diveDelegate
|
||||
//boundsBehavior: Flickable.StopAtBounds
|
||||
maximumFlickVelocity: parent.height * 5
|
||||
bottomMargin: Kirigami.Units.iconSizes.medium + Kirigami.Units.gridUnit
|
||||
cacheBuffer: 0 // seems to avoid empty rendered profiles
|
||||
section.property: "dive.tripMeta"
|
||||
section.criteria: ViewSection.FullString
|
||||
section.delegate: tripHeading
|
||||
header: Kirigami.Heading {
|
||||
x: Kirigami.Units.gridUnit / 2
|
||||
height: paintedHeight + Kirigami.Units.gridUnit / 2
|
||||
verticalAlignment: Text.AlignBottom
|
||||
text: "Dive Log"
|
||||
}
|
||||
Connections {
|
||||
target: detailsWindow
|
||||
onCurrentIndexChanged: diveListView.currentIndex = detailsWindow.currentIndex
|
||||
}
|
||||
Connections {
|
||||
target: stackView
|
||||
onDepthChanged: {
|
||||
if (stackView.depth === 1) {
|
||||
diveListView.currentIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
id: outerScrollView
|
||||
anchors.fill: parent
|
||||
opacity: 0.8 - startPageWrapper.opacity
|
||||
visible: opacity > 0
|
||||
ListView {
|
||||
id: diveListView
|
||||
anchors.fill: parent
|
||||
model: diveModel
|
||||
currentIndex: -1
|
||||
delegate: diveDelegate
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
maximumFlickVelocity: parent.height * 5
|
||||
bottomMargin: MobileComponents.Units.iconSizes.medium + MobileComponents.Units.gridUnit
|
||||
cacheBuffer: 0 // seems to avoid empty rendered profiles
|
||||
section.property: "dive.tripMeta"
|
||||
section.criteria: ViewSection.FullString
|
||||
section.delegate: tripHeading
|
||||
header: MobileComponents.Heading {
|
||||
x: MobileComponents.Units.gridUnit / 2
|
||||
height: paintedHeight + MobileComponents.Units.gridUnit / 2
|
||||
verticalAlignment: Text.AlignBottom
|
||||
text: "Dive Log"
|
||||
color: textColor
|
||||
}
|
||||
Connections {
|
||||
target: detailsWindow
|
||||
onCurrentIndexChanged: diveListView.currentIndex = detailsWindow.currentIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property QtObject saveAction: Action {
|
||||
iconName: "document-save"
|
||||
|
@ -209,25 +229,4 @@ MobileComponents.Page {
|
|||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
id: startPageWrapper
|
||||
anchors.fill: parent
|
||||
opacity: (diveListView.count > 0 && (credentialStatus == QMLManager.VALID || credentialStatus == QMLManager.VALID_EMAIL)) ? 0 : 1
|
||||
visible: opacity > 0
|
||||
Behavior on opacity { NumberAnimation { duration: MobileComponents.Units.shortDuration } }
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
page.mainAction = page.saveAction
|
||||
showingDiveList = false
|
||||
} else {
|
||||
page.mainAction = null
|
||||
showingDiveList = true
|
||||
}
|
||||
}
|
||||
|
||||
StartPage {
|
||||
id: startPage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,14 +5,15 @@ import QtQuick.Window 2.2
|
|||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
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.Page {
|
||||
id: diveComputerDownloadWindow
|
||||
anchors.top:parent.top
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
Layout.fillWidth: true;
|
||||
title: "Dive Computer"
|
||||
|
||||
/* this can be done by hitting the back key
|
||||
contextualActions: [
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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: logWindow
|
||||
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: "Log"
|
||||
title: "Application Log"
|
||||
|
||||
/* this can be done by hitting the back key
|
||||
contextualActions: [
|
||||
|
@ -26,26 +27,24 @@ MobileComponents.Page {
|
|||
}
|
||||
]
|
||||
*/
|
||||
ScrollView {
|
||||
|
||||
Flickable {
|
||||
id: logFlick
|
||||
anchors.fill: parent
|
||||
Flickable {
|
||||
id: logFlick
|
||||
anchors.fill: parent
|
||||
contentHeight: logContent.height
|
||||
clip: true
|
||||
ColumnLayout {
|
||||
width: logFlick.width
|
||||
spacing: MobileComponents.Units.smallSpacing
|
||||
MobileComponents.Heading {
|
||||
text: "Application Log"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
id: logContent
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.maximumWidth: parent.width
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
text: manager.logText
|
||||
}
|
||||
contentHeight: logContent.height
|
||||
clip: true
|
||||
ColumnLayout {
|
||||
width: logFlick.width
|
||||
spacing: Kirigami.Units.smallSpacing
|
||||
Kirigami.Heading {
|
||||
text: "Application Log"
|
||||
}
|
||||
Kirigami.Label {
|
||||
id: logContent
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.maximumWidth: parent.width
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
text: manager.logText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@ import QtQuick.Controls 1.2
|
|||
import QtQuick.Window 2.2
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
|
||||
MobileComponents.Page {
|
||||
Kirigami.Page {
|
||||
|
||||
title: "Preferences"
|
||||
mainAction: Action {
|
||||
text: "Save"
|
||||
iconName: "document-save"
|
||||
|
@ -24,27 +25,27 @@ MobileComponents.Page {
|
|||
signal accept
|
||||
|
||||
columns: 2
|
||||
width: parent.width - MobileComponents.Units.gridUnit
|
||||
width: parent.width - Kirigami.Units.gridUnit
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: MobileComponents.Units.gridUnit / 2
|
||||
margins: Kirigami.Units.gridUnit / 2
|
||||
}
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
text: "Preferences"
|
||||
Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
|
||||
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
|
||||
Layout.columnSpan: 2
|
||||
}
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
text: "Subsurface GPS data webservice"
|
||||
level: 3
|
||||
Layout.topMargin: MobileComponents.Units.largeSpacing
|
||||
Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
|
||||
Layout.columnSpan: 2
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Distance threshold (meters)"
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
|
@ -55,7 +56,7 @@ MobileComponents.Page {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Time threshold (minutes)"
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import QtQuick 2.5
|
|||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls.Styles 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
|
||||
ColumnLayout {
|
||||
|
@ -11,23 +11,23 @@ ColumnLayout {
|
|||
|
||||
function saveCredentials() { cloudCredentials.saveCredentials() }
|
||||
|
||||
MobileComponents.Heading {
|
||||
Layout.margins: MobileComponents.Units.gridUnit
|
||||
Kirigami.Heading {
|
||||
Layout.margins: Kirigami.Units.gridUnit
|
||||
text: "Subsurface-mobile"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: explanationText
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: MobileComponents.Units.gridUnit
|
||||
Layout.margins: Kirigami.Units.gridUnit
|
||||
Layout.topMargin: 0
|
||||
text: "In order to use Subsurface-mobile you need to have a Subsurface cloud storage account " +
|
||||
"(which can be created with the Subsurface desktop application)."
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
id: messageArea
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: MobileComponents.Units.gridUnit
|
||||
Layout.margins: Kirigami.Units.gridUnit
|
||||
Layout.topMargin: 0
|
||||
text: manager.startPageText
|
||||
wrapMode: Text.WordWrap
|
||||
|
@ -35,7 +35,7 @@ ColumnLayout {
|
|||
CloudCredentials {
|
||||
id: cloudCredentials
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: MobileComponents.Units.gridUnit
|
||||
Layout.margins: Kirigami.Units.gridUnit
|
||||
Layout.topMargin: 0
|
||||
property int headingLevel: 3
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls.Styles 1.2
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
|
||||
Button {
|
||||
style: ButtonStyle {
|
||||
padding {
|
||||
top: MobileComponents.Units.smallSpacing * 2
|
||||
left: MobileComponents.Units.smallSpacing * 4
|
||||
right: MobileComponents.Units.smallSpacing * 4
|
||||
bottom: MobileComponents.Units.smallSpacing * 2
|
||||
top: Kirigami.Units.smallSpacing * 2
|
||||
left: Kirigami.Units.smallSpacing * 4
|
||||
right: Kirigami.Units.smallSpacing * 4
|
||||
bottom: Kirigami.Units.smallSpacing * 2
|
||||
}
|
||||
background: Rectangle {
|
||||
border.width: 1
|
||||
|
|
|
@ -2,10 +2,11 @@ import QtQuick 2.5
|
|||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.2
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
|
||||
MobileComponents.Page {
|
||||
Kirigami.Page {
|
||||
|
||||
title: "Theme Information"
|
||||
/* this can be done by hitting the back key
|
||||
contextualActions: [
|
||||
Action {
|
||||
|
@ -21,14 +22,14 @@ MobileComponents.Page {
|
|||
GridLayout {
|
||||
id: themetest
|
||||
columns: 2
|
||||
anchors.margins: MobileComponents.Units.gridUnit / 2
|
||||
anchors.margins: Kirigami.Units.gridUnit / 2
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
Layout.columnSpan: 2
|
||||
text: "Theme Information"
|
||||
}
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
text: "Screen"
|
||||
Layout.columnSpan: 2
|
||||
level: 3
|
||||
|
@ -37,76 +38,76 @@ MobileComponents.Page {
|
|||
id: fm
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Geometry (pixels):"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: rootItem.width + "x" + rootItem.height
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Geometry (gridUnits):"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
text: Math.round(rootItem.width / MobileComponents.Units.gridUnit) + "x" + Math.round(rootItem.height / MobileComponents.Units.gridUnit)
|
||||
Kirigami.Label {
|
||||
text: Math.round(rootItem.width / Kirigami.Units.gridUnit) + "x" + Math.round(rootItem.height / Kirigami.Units.gridUnit)
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Units.gridUnit:"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
text: MobileComponents.Units.gridUnit
|
||||
Kirigami.Label {
|
||||
text: Kirigami.Units.gridUnit
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Units.devicePixelRatio:"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: Screen.devicePixelRatio
|
||||
}
|
||||
|
||||
MobileComponents.Heading {
|
||||
Kirigami.Heading {
|
||||
text: "Font Metrics"
|
||||
level: 3
|
||||
Layout.columnSpan: 2
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "FontMetrics pointSize:"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: fm.font.pointSize
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "FontMetrics pixelSize:"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: fm.height
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "FontMetrics devicePixelRatio:"
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: fm.height / fm.font.pointSize
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Text item pixelSize:"
|
||||
}
|
||||
Text {
|
||||
text: font.pixelSize
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: "Text item pointSize:"
|
||||
}
|
||||
Text {
|
||||
text: font.pointSize
|
||||
}
|
||||
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
|
|
@ -5,21 +5,21 @@ import QtQuick.Window 2.2
|
|||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.2
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kirigami 1.0 as Kirigami
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
|
||||
Rectangle {
|
||||
id: topPart
|
||||
|
||||
color: subsurfaceTheme.accentColor
|
||||
Layout.minimumHeight: Math.round(MobileComponents.Units.gridUnit * 1.5)
|
||||
Layout.minimumHeight: Math.round(Kirigami.Units.gridUnit * 1.5)
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 0
|
||||
RowLayout {
|
||||
anchors.verticalCenter: topPart.verticalCenter
|
||||
Item {
|
||||
Layout.preferredHeight: subsurfaceLogo.height
|
||||
Layout.leftMargin: MobileComponents.Units.gridUnit / 4
|
||||
Layout.leftMargin: Kirigami.Units.gridUnit / 4
|
||||
Image {
|
||||
id: subsurfaceLogo
|
||||
source: "qrc:/qml/subsurface-mobile-icon.png"
|
||||
|
@ -27,16 +27,16 @@ Rectangle {
|
|||
verticalCenter: parent.Center
|
||||
left: parent.left
|
||||
}
|
||||
width: Math.round(MobileComponents.Units.gridUnit)
|
||||
width: Math.round(Kirigami.Units.gridUnit)
|
||||
height: width
|
||||
}
|
||||
MobileComponents.Label {
|
||||
Kirigami.Label {
|
||||
text: qsTr("Subsurface-mobile")
|
||||
font.pointSize: Math.round(MobileComponents.Theme.defaultFont.pointSize)
|
||||
font.pointSize: Math.round(Kirigami.Theme.defaultFont.pointSize)
|
||||
height: subsurfaceLogo.height
|
||||
anchors {
|
||||
left: subsurfaceLogo.right
|
||||
leftMargin: Math.round(MobileComponents.Units.gridUnit / 2)
|
||||
leftMargin: Math.round(Kirigami.Units.gridUnit / 2)
|
||||
}
|
||||
font.weight: Font.Light
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
|
|
@ -6,11 +6,15 @@ 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")
|
||||
|
||||
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
|
||||
|
@ -42,13 +46,13 @@ MobileComponents.ApplicationWindow {
|
|||
diveList.scrollToTop()
|
||||
}
|
||||
|
||||
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: {
|
||||
manager.appendTextToLog("requested dive list with credential status " + manager.credentialStatus)
|
||||
|
@ -63,7 +67,7 @@ MobileComponents.ApplicationWindow {
|
|||
globalDrawer.close()
|
||||
}
|
||||
},
|
||||
Action {
|
||||
Kirigami.Action {
|
||||
text: "Cloud credentials"
|
||||
onTriggered: {
|
||||
returnTopPage()
|
||||
|
@ -77,7 +81,7 @@ MobileComponents.ApplicationWindow {
|
|||
manager.credentialStatus = QMLManager.UNKNOWN
|
||||
}
|
||||
},
|
||||
MobileComponents.ActionGroup {
|
||||
Kirigami.Action {
|
||||
text: "Manage dives"
|
||||
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL
|
||||
/*
|
||||
|
@ -90,7 +94,7 @@ MobileComponents.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
*/
|
||||
Action {
|
||||
Kirigami.Action {
|
||||
text: "Add dive manually"
|
||||
onTriggered: {
|
||||
detailsWindow.state = "add"
|
||||
|
@ -113,7 +117,7 @@ MobileComponents.ApplicationWindow {
|
|||
stackView.push(detailsWindow)
|
||||
}
|
||||
}
|
||||
Action {
|
||||
Kirigami.Action {
|
||||
text: "Refresh"
|
||||
onTriggered: {
|
||||
globalDrawer.close()
|
||||
|
@ -131,31 +135,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();
|
||||
|
@ -163,13 +167,13 @@ MobileComponents.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Action {
|
||||
Kirigami.Action {
|
||||
text: "Clear GPS cache"
|
||||
onTriggered: {
|
||||
manager.clearGpsData();
|
||||
}
|
||||
}
|
||||
Action {
|
||||
Kirigami.Action {
|
||||
text: "Preferences"
|
||||
onTriggered: {
|
||||
stackView.push(prefsWindow)
|
||||
|
@ -178,29 +182,29 @@ 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 {
|
||||
text: "User manual"
|
||||
onTriggered: {
|
||||
manager.showUserManual()
|
||||
}
|
||||
},
|
||||
Action {
|
||||
Kirigami.Action {
|
||||
text: "About"
|
||||
onTriggered: {
|
||||
stackView.push(aboutWindow)
|
||||
|
@ -211,7 +215,7 @@ MobileComponents.ApplicationWindow {
|
|||
|
||||
MouseArea {
|
||||
height: childrenRect.height
|
||||
width: MobileComponents.Units.gridUnit * 10
|
||||
width: Kirigami.Units.gridUnit * 10
|
||||
CheckBox {
|
||||
//text: "Run location service"
|
||||
id: locationCheckbox
|
||||
|
@ -224,8 +228,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
|
||||
|
@ -240,7 +244,7 @@ MobileComponents.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
contextDrawer: MobileComponents.ContextDrawer {
|
||||
contextDrawer: Kirigami.ContextDrawer {
|
||||
id: contextDrawer
|
||||
actions: rootItem.pageStack.currentPage ? rootItem.pageStack.currentPage.contextualActions : null
|
||||
title: "Actions"
|
||||
|
@ -253,17 +257,19 @@ MobileComponents.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 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
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
toolBar: TopBar {
|
||||
width: parent.width
|
||||
height: Layout.minimumHeight
|
||||
}
|
||||
*/
|
||||
|
||||
property Item stackView: pageStack
|
||||
initialPage: DiveList {
|
||||
pageStack.initialPage: DiveList {
|
||||
anchors.fill: detailsPage
|
||||
id: diveList
|
||||
opacity: 0
|
||||
Behavior on opacity {
|
||||
|
@ -308,6 +314,7 @@ MobileComponents.ApplicationWindow {
|
|||
|
||||
GpsList {
|
||||
id: gpsWindow
|
||||
visible: false
|
||||
}
|
||||
|
||||
ThemeTest {
|
||||
|
@ -316,6 +323,7 @@ MobileComponents.ApplicationWindow {
|
|||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
Kirigami.Theme.highlightColor = subsurfaceTheme.accentColor
|
||||
manager.finishSetup();
|
||||
rootItem.visible = true
|
||||
diveList.opacity = 1
|
||||
|
|
|
@ -24,36 +24,41 @@
|
|||
<file alias="menu-back.png">icons/menu-back.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/imports">
|
||||
<file alias="org/kde/plasma/mobilecomponents/qmldir">mobilecomponents/qmldir</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/ActionGroup.qml">mobilecomponents/ActionGroup.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/ApplicationWindow.qml">mobilecomponents/ApplicationWindow.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/BasicListItem.qml">mobilecomponents/BasicListItem.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/GlobalDrawer.qml">mobilecomponents/GlobalDrawer.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/ContextDrawer.qml">mobilecomponents/ContextDrawer.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/Page.qml">mobilecomponents/Page.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/Icon.qml">mobilecomponents/Icon.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/Heading.qml">mobilecomponents/Heading.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/PageRow.qml">mobilecomponents/PageRow.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/Label.qml">mobilecomponents/Label.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/ListItem.qml">mobilecomponents/ListItem.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/ListItemWithActions.qml">mobilecomponents/ListItemWithActions.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/OverlayDrawer.qml">mobilecomponents/OverlayDrawer.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/Theme.qml">mobilecomponents/Theme.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/Units.qml">mobilecomponents/Units.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/private/ActionButton.qml">mobilecomponents/private/ActionButton.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/private/ActionButtonArrow.qml">mobilecomponents/private/ActionButtonArrow.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/private/AbstractDrawer.qml">mobilecomponents/private/AbstractDrawer.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/private/PageStack.js">mobilecomponents/private/PageStack.js</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/private/PassiveNotification.qml">mobilecomponents/private/PassiveNotification.qml</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/go-next.svg">mobilecomponents/icons/go-next.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/go-previous.svg">mobilecomponents/icons/go-previous.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/distribute-horizontal-x.svg">mobilecomponents/icons/distribute-horizontal-x.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/document-edit.svg">mobilecomponents/icons/document-edit.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/document-save.svg">mobilecomponents/icons/document-save.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/view-readermode.svg">mobilecomponents/icons/view-readermode.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/dialog-cancel.svg">mobilecomponents/icons/dialog-cancel.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/application-menu.svg">mobilecomponents/icons/application-menu.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/gps.svg">mobilecomponents/icons/gps.svg</file>
|
||||
<file alias="org/kde/plasma/mobilecomponents/icons/trash-empty.svg">mobilecomponents/icons/trash-empty.svg</file>
|
||||
<file alias="org/kde/kirigami/qmldir">kirigami/qmldir</file>
|
||||
<file alias="org/kde/kirigami/Action.qml">kirigami/Action.qml</file>
|
||||
<file alias="org/kde/kirigami/ApplicationWindow.qml">kirigami/ApplicationWindow.qml</file>
|
||||
<file alias="org/kde/kirigami/BasicListItem.qml">kirigami/BasicListItem.qml</file>
|
||||
<file alias="org/kde/kirigami/GlobalDrawer.qml">kirigami/GlobalDrawer.qml</file>
|
||||
<file alias="org/kde/kirigami/ContextDrawer.qml">kirigami/ContextDrawer.qml</file>
|
||||
<file alias="org/kde/kirigami/Page.qml">kirigami/Page.qml</file>
|
||||
<file alias="org/kde/kirigami/ScrollablePage.qml">kirigami/ScrollablePage.qml</file>
|
||||
<file alias="org/kde/kirigami/Icon.qml">kirigami/Icon.qml</file>
|
||||
<file alias="org/kde/kirigami/Heading.qml">kirigami/Heading.qml</file>
|
||||
<file alias="org/kde/kirigami/OverlaySheet.qml">kirigami/OverlaySheet.qml</file>
|
||||
<file alias="org/kde/kirigami/ApplicationHeader.qml">kirigami/ApplicationHeader.qml</file>
|
||||
<file alias="org/kde/kirigami/private/PageRow.qml">kirigami/private/PageRow.qml</file>
|
||||
<file alias="org/kde/kirigami/Label.qml">kirigami/Label.qml</file>
|
||||
<file alias="org/kde/kirigami/AbstractListItem.qml">kirigami/AbstractListItem.qml</file>
|
||||
<file alias="org/kde/kirigami/SwipeListItem.qml">kirigami/SwipeListItem.qml</file>
|
||||
<file alias="org/kde/kirigami/OverlayDrawer.qml">kirigami/OverlayDrawer.qml</file>
|
||||
<file alias="org/kde/kirigami/Theme.qml">kirigami/Theme.qml</file>
|
||||
<file alias="org/kde/kirigami/Units.qml">kirigami/Units.qml</file>
|
||||
<file alias="org/kde/kirigami/private/RefreshableScrollView.qml">kirigami/private/RefreshableScrollView.qml</file>
|
||||
<file alias="org/kde/kirigami/private/ActionButton.qml">kirigami/private/ActionButton.qml</file>
|
||||
<file alias="org/kde/kirigami/private/MenuIcon.qml">kirigami/private/MenuIcon.qml</file>
|
||||
<file alias="org/kde/kirigami/private/ContextIcon.qml">kirigami/private/ContextIcon.qml</file>
|
||||
<file alias="org/kde/kirigami/private/AbstractDrawer.qml">kirigami/private/AbstractDrawer.qml</file>
|
||||
<file alias="org/kde/kirigami/private/PageStack.js">kirigami/private/PageStack.js</file>
|
||||
<file alias="org/kde/kirigami/private/PassiveNotification.qml">kirigami/private/PassiveNotification.qml</file>
|
||||
<file alias="org/kde/kirigami/icons/go-next.svg">kirigami/icons/go-next.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/go-previous.svg">kirigami/icons/go-previous.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/distribute-horizontal-x.svg">kirigami/icons/distribute-horizontal-x.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/document-edit.svg">kirigami/icons/document-edit.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/document-save.svg">kirigami/icons/document-save.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/view-readermode.svg">kirigami/icons/view-readermode.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/dialog-cancel.svg">kirigami/icons/dialog-cancel.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/application-menu.svg">kirigami/icons/application-menu.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/gps.svg">kirigami/icons/gps.svg</file>
|
||||
<file alias="org/kde/kirigami/icons/trash-empty.svg">kirigami/icons/trash-empty.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -14,35 +14,46 @@ if [ ! -d "$SRC/subsurface" ] || [ ! -d "qt-mobile" ] || [ ! -d "subsurface-core
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# now bring in the latest Plasma-mobile mobile components plus a couple of icons that we need
|
||||
if [ "$1" = "-nopull" ] ; then
|
||||
NOPULL=1
|
||||
fi
|
||||
|
||||
# now bring in the latest Kirigami mobile components plus a couple of icons that we need
|
||||
# first, get the latest from upstream
|
||||
# yes, this is a bit overkill as we clone a lot of stuff for just a few files, but this way
|
||||
# we stop having to manually merge our code with upstream all the time
|
||||
# as we get closer to shipping a production version we'll likely check out specific tags
|
||||
# or SHAs from upstream
|
||||
cd $SRC
|
||||
if [ ! -d plasma-mobile ] ; then
|
||||
git clone git://github.com/KDE/plasma-mobile
|
||||
if [ ! -d kirigami ] ; then
|
||||
git clone git://github.com/KDE/kirigami
|
||||
fi
|
||||
if [ "$NOPULL" = "" ] ; then
|
||||
pushd kirigami
|
||||
git pull
|
||||
popd
|
||||
fi
|
||||
pushd plasma-mobile
|
||||
git pull
|
||||
popd
|
||||
if [ ! -d breeze-icons ] ; then
|
||||
git clone git://anongit.kde.org/breeze-icons
|
||||
fi
|
||||
pushd breeze-icons
|
||||
git pull
|
||||
popd
|
||||
if [ "$NOPULL" = "" ] ; then
|
||||
pushd breeze-icons
|
||||
git pull
|
||||
popd
|
||||
fi
|
||||
|
||||
# now copy the components and a couple of icons into plae
|
||||
MC=$SRC/subsurface/qt-mobile/qml/mobilecomponents
|
||||
PMMC=plasma-mobile/components/mobilecomponents
|
||||
MC=$SRC/subsurface/qt-mobile/qml/kirigami
|
||||
PMMC=kirigami/src/qml
|
||||
BREEZE=breeze-icons
|
||||
|
||||
rm -rf $MC
|
||||
mkdir -p $MC/icons
|
||||
cp -R $PMMC/qml/* $MC/
|
||||
cp $PMMC/fallbacktheme/*qml $MC/
|
||||
cp -R $PMMC/* $MC/
|
||||
cp $PMMC/../fallbacktheme/*qml $MC/
|
||||
|
||||
# fix plugin requirement
|
||||
sed -i -e 's/^plugin kirigamiplugin/# plugin kirigamiplugin/' $MC/qmldir
|
||||
|
||||
cp $BREEZE/icons/actions/24/dialog-cancel.svg $MC/icons
|
||||
cp $BREEZE/icons/actions/24/distribute-horizontal-x.svg $MC/icons
|
||||
|
@ -55,4 +66,4 @@ cp $BREEZE/icons/actions/24/application-menu.svg $MC/icons
|
|||
cp $BREEZE/icons/actions/22/gps.svg $MC/icons
|
||||
cp $BREEZE/icons/actions/24/trash-empty.svg $MC/icons
|
||||
|
||||
echo org.kde.plasma.mobilecomponents synced from upstream
|
||||
echo org.kde.plasma.kirigami synced from upstream
|
||||
|
|
Loading…
Reference in a new issue