Commit 2586bfd7 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Implement disruption and notes

parent 8a81ecf9
...@@ -74,10 +74,10 @@ Kirigami.Page ...@@ -74,10 +74,10 @@ Kirigami.Page
id: headerLabel id: headerLabel
anchors.fill: parent anchors.fill: parent
anchors.margins: Kirigami.Units.largeSpacing anchors.margins: Kirigami.Units.largeSpacing
color: Kirigami.Theme.textColor
font.pointSize: Kirigami.Theme.defaultFont.pointSize * root.headerFontScale font.pointSize: Kirigami.Theme.defaultFont.pointSize * root.headerFontScale
Layout.fillWidth: true Layout.fillWidth: true
font.strikeout: theData.disruptionEffect == Disruption.NoService
color: theData.disruptionEffect == Disruption.NoService ? "red" : Kirigami.Theme.textColor
text: theData.route.line.name text: theData.route.line.name
} }
} }
...@@ -128,6 +128,11 @@ Kirigami.Page ...@@ -128,6 +128,11 @@ Kirigami.Page
text: theData.scheduledArrivalPlatform text: theData.scheduledArrivalPlatform
} }
} }
Label {
text: theData.note
wrapMode: Text.Wrap
}
} }
} }
} }
......
...@@ -55,15 +55,26 @@ Kirigami.Page ...@@ -55,15 +55,26 @@ Kirigami.Page
delegate: Kirigami.AbstractListItem { delegate: Kirigami.AbstractListItem {
onClicked: pageStack.push(Qt.resolvedUrl("ConnectionDetailsPage.qml"), {journey: journey}) onClicked: pageStack.push(Qt.resolvedUrl("ConnectionDetailsPage.qml"), {journey: journey})
readonly property bool cancelled: {
var disrupt = false
journey.sections.forEach(sec => {
if (sec.disruptionEffect == KPT.Disruption.NoService) {
disrupt = true
}
})
return disrupt
}
RowLayout { RowLayout {
Label { Label {
text: i18n("%1 - %2", journey.sections[0].scheduledDepartureTime.toLocaleTimeString(Locale.ShortFormat), journey.sections[journey.sections.length - 1].scheduledArrivalTime.toLocaleTimeString(Locale.ShortFormat)) text: i18n("%1 - %2", journey.sections[0].scheduledDepartureTime.toLocaleTimeString(Locale.ShortFormat), journey.sections[journey.sections.length - 1].scheduledArrivalTime.toLocaleTimeString(Locale.ShortFormat))
font.strikeout: cancelled
} }
Label { Label {
text: i18n("(%1)", _formatter.formatDuration(journey.duration)) text: i18n("(%1)", _formatter.formatDuration(journey.duration))
Layout.fillWidth: !delayLabel.visible Layout.fillWidth: !delayLabel.visible
font.strikeout: cancelled
} }
Label { Label {
...@@ -72,11 +83,13 @@ Kirigami.Page ...@@ -72,11 +83,13 @@ Kirigami.Page
visible: journey.sections[journey.sections.length - 1].hasExpectedArrivalTime visible: journey.sections[journey.sections.length - 1].hasExpectedArrivalTime
text: i18n("+%1", journey.sections[journey.sections.length - 1].arrivalDelay) text: i18n("+%1", journey.sections[journey.sections.length - 1].arrivalDelay)
color: journey.sections[journey.sections.length - 1].arrivalDelay > 0 ? "red" : "green" color: journey.sections[journey.sections.length - 1].arrivalDelay > 0 ? "red" : "green"
font.strikeout: cancelled
} }
Label { Label {
text: i18np("%1 change", "%1 changes", journey.numberOfChanges) text: i18np("%1 change", "%1 changes", journey.numberOfChanges)
visible: journey.numberOfChanges > 0 visible: journey.numberOfChanges > 0
font.strikeout: cancelled
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment