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:
Dirk Hohndel 2016-03-31 21:57:12 -05:00
commit 2efa047999
17 changed files with 436 additions and 423 deletions

View file

@ -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();
}