@@ -25,19 +25,15 @@ Item { // Reuse it for TripDetailPage and TripDetail
2525 property bool showAlerts: true
2626 property var vias
2727 property var viasModel
28- property var alertsModel
28+ property var alerts
2929 property var stopsModel: viasModel // BeRail V1.X build stopsModel with intermediate stops
3030
3131 // Internal variables
3232 property var _hasDelay: [departDelay > 0 , arriveDelay > 0 ]
3333 property int _changeIndex
34- property bool _hasAlert: alerts .count > 0
34+ property bool _hasAlert: alerts .length > 0
3535
36- onAlertsModelChanged: { // Convert to ListModel
37- for (var i= 0 ; i < alertsModel .length ; i++ ) {
38- alerts .append (alertsModel[i]);
39- }
40- }
36+ onAlertsChanged: Trip .convertAlertsToListmodel (alerts)
4137
4238 Column {
4339 id: tripColumn
@@ -80,7 +76,7 @@ Item { // Reuse it for TripDetailPage and TripDetail
8076 // Depart station name
8177 Label {
8278 id: departStationLabel
83- width: parent .width - departTimeItem .width - journeyInformation .width - 2 * Theme .paddingLarge
79+ width: parent .width - departTimeItem .width - journeyInformation .width - 3 * Theme .paddingLarge
8480 anchors { left: departTimeItem .right ; leftMargin: Theme .paddingLarge }
8581 truncationMode: TruncationMode .Fade
8682 font .capitalization : Font .AllUppercase
@@ -145,7 +141,7 @@ Item { // Reuse it for TripDetailPage and TripDetail
145141 Label {
146142 id: alertsLabel;
147143 anchors { top: changeIcon .bottom ; topMargin: Theme .paddingMedium }
148- text: alertsModel .length
144+ text: alerts .length
149145 visible: _hasAlert
150146 }
151147
@@ -190,7 +186,7 @@ Item { // Reuse it for TripDetailPage and TripDetail
190186 // Progress indicator stops
191187 Column {
192188 anchors { horizontalCenter: traject .horizontalCenter ; top: parent .top ; topMargin: Theme .itemSizeSmall }
193- spacing: Theme .paddingLarge * 2
189+ spacing: Theme .paddingLarge * 3
194190 Repeater {
195191 id: stopsProgress
196192 model: viasModel
@@ -244,10 +240,17 @@ Item { // Reuse it for TripDetailPage and TripDetail
244240
245241 // Stop name
246242 Label {
243+ id: viaStopStationLabel
247244 anchors { left: viaStopBullet .visible ? viaStopBullet .right : stopBullet .right ; leftMargin: Theme .paddingLarge ; right: parent .right ; rightMargin: Theme .paddingMedium ; verticalCenter: parent .verticalCenter }
248245 font .capitalization : Font .SmallCaps
249246 text: modelData .station
250247 }
248+
249+ Label {
250+ anchors { left: viaStopBullet .visible ? viaStopBullet .right : stopBullet .right ; leftMargin: Theme .paddingLarge ; right: parent .right ; rightMargin: Theme .paddingMedium ; top: viaStopStationLabel .bottom ; topMargin: Theme .paddingSmall }
251+ font .pixelSize : Theme .fontSizeTiny
252+ text: qsTr (" Track %1 → Track %2" ).arg (modelData .arrival .platform ).arg (modelData .depart .platform ) + " | ⏱" + modelData .timebetween
253+ }
251254 }
252255 }
253256 }
@@ -291,7 +294,7 @@ Item { // Reuse it for TripDetailPage and TripDetail
291294 // Arrive station name
292295 Label {
293296 id: arriveStationLabel
294- width: parent .width - arriveTimeItem .width - journeyInformation .width - 2 * Theme .paddingLarge
297+ width: parent .width - arriveTimeItem .width - journeyInformation .width - 3 * Theme .paddingLarge
295298 anchors { left: arriveTimeItem .right ; leftMargin: Theme .paddingLarge }
296299 truncationMode: TruncationMode .Fade
297300 font .capitalization : Font .AllUppercase
@@ -336,13 +339,14 @@ Item { // Reuse it for TripDetailPage and TripDetail
336339 }
337340
338341 ListModel {
339- id: alerts
342+ id: alertsModel
340343 }
341344
342345 DisturbancesView {
343346 id: alertsView
344- model: alerts
347+ model: alertsModel
345348 showStation: false
349+ visible: expanded // Only visible when expanded
346350 }
347351 }
348352
0 commit comments