mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/dive-details: use our labels to create denser display
This makes better use of the screen real estate, without (IMHO) seeming too crowded. This is a tough balance to strike. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7720e97db5
commit
6e47bb11d5
1 changed files with 36 additions and 24 deletions
|
@ -63,26 +63,26 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Controls.Label {
|
TemplateLabel {
|
||||||
text: dateTime
|
text: dateTime
|
||||||
width: Math.max(locationText.width * 0.45, paintedWidth)
|
width: Math.max(locationText.width * 0.45, paintedWidth)
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
// spacer, just in case
|
// spacer, just in case
|
||||||
Controls.Label {
|
TemplateLabel {
|
||||||
text: " "
|
text: " "
|
||||||
width: Kirigami.Units.largeSpacing
|
width: Kirigami.Units.largeSpacing
|
||||||
}
|
}
|
||||||
// let's try to show the depth / duration very compact
|
// let's try to show the depth / duration very compact
|
||||||
Controls.Label {
|
TemplateLabel {
|
||||||
text: depthDuration
|
text: depthDuration
|
||||||
width: Math.max(Kirigami.Units.gridUnit * 3, paintedWidth)
|
width: Math.max(Kirigami.Units.gridUnit * 3, paintedWidth)
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabel {
|
||||||
id: numberText
|
id: numberText
|
||||||
text: "#" + number
|
text: "#" + number
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
|
@ -99,7 +99,7 @@ Item {
|
||||||
top: numberText.bottom
|
top: numberText.bottom
|
||||||
topMargin: Kirigami.Units.smallSpacing
|
topMargin: Kirigami.Units.smallSpacing
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: ratingText
|
id: ratingText
|
||||||
text: qsTr("Rating:")
|
text: qsTr("Rating:")
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
|
@ -109,6 +109,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: ratingText.verticalCenter
|
anchors.verticalCenter: ratingText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (rating >= 1) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (rating >= 1) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -116,6 +117,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: ratingText.verticalCenter
|
anchors.verticalCenter: ratingText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (rating >= 2) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (rating >= 2) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -123,6 +125,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: ratingText.verticalCenter
|
anchors.verticalCenter: ratingText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (rating >= 3) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (rating >= 3) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -130,6 +133,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: ratingText.verticalCenter
|
anchors.verticalCenter: ratingText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (rating >= 4) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (rating >= 4) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -137,6 +141,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: ratingText.verticalCenter
|
anchors.verticalCenter: ratingText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (rating === 5) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (rating === 5) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -147,7 +152,7 @@ Item {
|
||||||
top: numberText.bottom
|
top: numberText.bottom
|
||||||
topMargin: Kirigami.Units.smallSpacing
|
topMargin: Kirigami.Units.smallSpacing
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: visibilityText
|
id: visibilityText
|
||||||
text: qsTr("Visibility:")
|
text: qsTr("Visibility:")
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
|
@ -157,6 +162,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: visibilityText.verticalCenter
|
anchors.verticalCenter: visibilityText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (viz >= 1) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (viz >= 1) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -164,6 +170,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: visibilityText.verticalCenter
|
anchors.verticalCenter: visibilityText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (viz >= 2) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (viz >= 2) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -171,6 +178,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: visibilityText.verticalCenter
|
anchors.verticalCenter: visibilityText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (viz >= 3) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (viz >= 3) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -178,6 +186,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: visibilityText.verticalCenter
|
anchors.verticalCenter: visibilityText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (viz >= 4) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (viz >= 4) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -185,6 +194,7 @@ Item {
|
||||||
width: height
|
width: height
|
||||||
height: subsurfaceTheme.regularPointSize
|
height: subsurfaceTheme.regularPointSize
|
||||||
anchors.verticalCenter: visibilityText.verticalCenter
|
anchors.verticalCenter: visibilityText.verticalCenter
|
||||||
|
anchors.verticalCenterOffset: height * 0.2
|
||||||
source: (viz === 5) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
source: (viz === 5) ? ":/icons/ic_star.svg" : ":/icons/ic_star_border.svg"
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
|
@ -331,7 +341,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: noProfile
|
id: noProfile
|
||||||
visible: noDive
|
visible: noDive
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -343,21 +353,21 @@ Item {
|
||||||
|
|
||||||
// first row
|
// first row
|
||||||
//-----------
|
//-----------
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Suit:")
|
text: qsTr("Suit:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col1Width
|
Layout.maximumWidth: detailsView.col1Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Air Temp:")
|
text: qsTr("Air Temp:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col2Width
|
Layout.maximumWidth: detailsView.col2Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Water Temp:")
|
text: qsTr("Water Temp:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -367,21 +377,21 @@ Item {
|
||||||
|
|
||||||
// second row
|
// second row
|
||||||
//------------
|
//------------
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtSuit
|
id: txtSuit
|
||||||
text: suit
|
text: suit
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col1Width
|
Layout.maximumWidth: detailsView.col1Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtAirTemp
|
id: txtAirTemp
|
||||||
text: airTemp
|
text: airTemp
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col2Width
|
Layout.maximumWidth: detailsView.col2Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtWaterTemp
|
id: txtWaterTemp
|
||||||
text: waterTemp
|
text: waterTemp
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -399,7 +409,7 @@ Item {
|
||||||
|
|
||||||
// thrid row
|
// thrid row
|
||||||
//------------
|
//------------
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Cylinder:")
|
text: qsTr("Cylinder:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -407,7 +417,7 @@ Item {
|
||||||
Layout.bottomMargin: 0
|
Layout.bottomMargin: 0
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Weight:")
|
text: qsTr("Weight:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -415,7 +425,7 @@ Item {
|
||||||
Layout.bottomMargin: 0
|
Layout.bottomMargin: 0
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("SAC:")
|
text: qsTr("SAC:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -426,21 +436,21 @@ Item {
|
||||||
|
|
||||||
// fourth row
|
// fourth row
|
||||||
//------------
|
//------------
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtCylinder
|
id: txtCylinder
|
||||||
text: cylinder
|
text: cylinder
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col1Width
|
Layout.maximumWidth: detailsView.col1Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtWeight
|
id: txtWeight
|
||||||
text: sumWeight
|
text: sumWeight
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col2Width
|
Layout.maximumWidth: detailsView.col2Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtSAC
|
id: txtSAC
|
||||||
text: sac
|
text: sac
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -458,7 +468,7 @@ Item {
|
||||||
|
|
||||||
// fifth row
|
// fifth row
|
||||||
//-----------
|
//-----------
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Divemaster:")
|
text: qsTr("Divemaster:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -466,7 +476,7 @@ Item {
|
||||||
Layout.bottomMargin: 0
|
Layout.bottomMargin: 0
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Buddy:")
|
text: qsTr("Buddy:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -478,14 +488,14 @@ Item {
|
||||||
|
|
||||||
// sixth row
|
// sixth row
|
||||||
//-----------
|
//-----------
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtDiveMaster
|
id: txtDiveMaster
|
||||||
text: diveMaster
|
text: diveMaster
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col1Width
|
Layout.maximumWidth: detailsView.col1Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
}
|
}
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
id: txtBuddy
|
id: txtBuddy
|
||||||
text: buddy
|
text: buddy
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
|
@ -502,8 +512,10 @@ Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notes on the bottom
|
||||||
|
//--------------------
|
||||||
|
|
||||||
Controls.Label {
|
TemplateLabelSmall {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
text: qsTr("Notes")
|
text: qsTr("Notes")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue