aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-29 20:08:15 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-29 20:08:15 -0500
commita065b974723896df91a8da93803fbb47571201bf (patch)
treeda553525883a1c20115e2f7cf31ce12a92ccc9ef /qt-mobile
parent83c72e7a79458826b677e82f108f3e92022c58b6 (diff)
downloadsubsurface-a065b974723896df91a8da93803fbb47571201bf.tar.gz
QML UI: make dives outside of dive trips always visible
Create small visible separation from the dive trip before. And make the dive trip header a slightly different color so they stand out between dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qml/DiveList.qml20
1 files changed, 13 insertions, 7 deletions
diff --git a/qt-mobile/qml/DiveList.qml b/qt-mobile/qml/DiveList.qml
index 988221efd..4b4c5794f 100644
--- a/qt-mobile/qml/DiveList.qml
+++ b/qt-mobile/qml/DiveList.qml
@@ -21,8 +21,8 @@ MobileComponents.Page {
enabled: true
checked: diveListView.currentIndex === model.index
width: parent.width
- height: dive.tripMeta == activeTrip ? diveDelegateItem.height : 0
- visible: dive.tripMeta == activeTrip ? true : false
+ height: dive.tripMeta == activeTrip || dive.tripMeta === "--" ? diveDelegateItem.height : 0
+ visible: dive.tripMeta == activeTrip || dive.tripMeta === "--" ? true : false
property real detailsOpacity : 0
property int horizontalPadding: MobileComponents.Units.gridUnit / 2 - MobileComponents.Units.smallSpacing + 1
@@ -113,8 +113,10 @@ MobileComponents.Page {
id: tripHeading
Item {
width: page.width - MobileComponents.Units.gridUnit
- height: childrenRect.height + MobileComponents.Units.smallSpacing * 2 + Math.max(2, MobileComponents.Units.gridUnit / 2)
-
+ height: (section !== "--") ?
+ childrenRect.height + MobileComponents.Units.smallSpacing * 2 + Math.max(2, MobileComponents.Units.gridUnit / 2) :
+ Math.max(2, MobileComponents.Units.gridUnit / 2)
+ visible: section !== "---"
MobileComponents.Heading {
id: sectionText
text: {
@@ -137,19 +139,23 @@ MobileComponents.Page {
leftMargin: MobileComponents.Units.gridUnit / 2
right: parent.right
}
- color: textColor
+ color: subsurfaceTheme.accentColor
level: 2
MouseArea {
anchors.fill: sectionText
+ enabled: section !== "--"
onClicked: {
- activeTrip = section
+ if (activeTrip != section)
+ activeTrip = section
+ else
+ activeTrip = ""
}
}
}
Rectangle {
height: Math.max(2, MobileComponents.Units.gridUnit / 12) // we want a thicker line
anchors {
- top: sectionText.bottom
+ top: section !== "--" ? sectionText.bottom : sectionText.top
left: parent.left
leftMargin: MobileComponents.Units.gridUnit * -2
rightMargin: MobileComponents.Units.gridUnit * -2