mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: better list of downloaded dives
Not the lsit is much more compact and shows a lot more dives even on smaller screens. And it's similar in style to the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b9e90441ca
commit
8c0a1c2e6d
1 changed files with 21 additions and 51 deletions
|
@ -17,16 +17,19 @@ Kirigami.AbstractListItem {
|
||||||
enabled: true
|
enabled: true
|
||||||
supportsMouseEvents: true
|
supportsMouseEvents: true
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
height: Math.round(Kirigami.Units.gridUnit * 1.8)
|
||||||
|
padding: 0
|
||||||
|
|
||||||
property real detailsOpacity : 0
|
property real detailsOpacity : 0
|
||||||
property int horizontalPadding: Kirigami.Units.gridUnit / 2 - Kirigami.Units.smallSpacing + 1
|
property color textColor: subsurfaceTheme.secondaryTextColor
|
||||||
property color textColor: subsurfaceTheme.textColor
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
id: downloadedDive
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height + Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.largeSpacing
|
||||||
spacing: horizontalPadding
|
padding: 0
|
||||||
|
anchors.leftMargin: Math.round (Kirigami.Units.largeSpacing / 2)
|
||||||
|
anchors.fill: parent
|
||||||
add: Transition {
|
add: Transition {
|
||||||
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 }
|
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 }
|
||||||
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 }
|
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 }
|
||||||
|
@ -36,6 +39,7 @@ Kirigami.AbstractListItem {
|
||||||
checked: innerListItem.selected;
|
checked: innerListItem.selected;
|
||||||
width: childrenRect.width - Kirigami.Units.smallSpacing;
|
width: childrenRect.width - Kirigami.Units.smallSpacing;
|
||||||
height: childrenRect.heigh - Kirigami.Units.smallSpacing;
|
height: childrenRect.heigh - Kirigami.Units.smallSpacing;
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
indicator: Rectangle {
|
indicator: Rectangle {
|
||||||
visible: diveIsSelected
|
visible: diveIsSelected
|
||||||
implicitWidth: 20
|
implicitWidth: 20
|
||||||
|
@ -61,52 +65,18 @@ Kirigami.AbstractListItem {
|
||||||
importModel.selectRow(index)
|
importModel.selectRow(index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Kirigami.Label {
|
||||||
id: diveListEntry
|
id: dateLabel
|
||||||
width: parent.width - diveIsSelected.width - Kirigami.Units.gridUnit * (innerListItem.deleteButtonVisible ? 3 : 1)
|
text: innerListItem.datetime
|
||||||
height: childrenRect.height - Kirigami.Units.smallSpacing
|
width: Math.round(parent.width * 0.35)
|
||||||
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
Kirigami.Label {
|
color: textColor
|
||||||
id: depthLabel
|
}
|
||||||
text: "Depth " + innerListItem.depth
|
Kirigami.Label {
|
||||||
font.weight: Font.Light
|
text: innerListItem.depth + ' / ' + innerListItem.duration
|
||||||
elide: Text.ElideRight
|
width: Math.round(parent.width * 0.35)
|
||||||
maximumLineCount: 1 // needed for elide to work at all
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
anchors {
|
color: textColor
|
||||||
left: parent.left
|
|
||||||
leftMargin: horizontalPadding
|
|
||||||
top: parent.top
|
|
||||||
right: dateLabel.left
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Kirigami.Label {
|
|
||||||
id: dateLabel
|
|
||||||
text: innerListItem.datetime
|
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
|
||||||
anchors {
|
|
||||||
bottom: parent.bottom
|
|
||||||
right: parent.right
|
|
||||||
top: parent.top
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
anchors {
|
|
||||||
top: depthLabel.bottom
|
|
||||||
left: parent.left
|
|
||||||
leftMargin: horizontalPadding
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: horizontalPadding
|
|
||||||
topMargin: - Kirigami.Units.smallSpacing * 2
|
|
||||||
}
|
|
||||||
Kirigami.Label {
|
|
||||||
text: qsTr('Duration: ')
|
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
|
||||||
}
|
|
||||||
Kirigami.Label {
|
|
||||||
text: innerListItem.duration
|
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue