From a3f5ea8e674d0d509c9090af36a20bea3ce49cce Mon Sep 17 00:00:00 2001 From: Luciano Montanaro Date: Thu, 12 Jan 2012 23:28:19 +0100 Subject: [PATCH] Improved platform display --- .../harmattan/qml/StationScheduleDelegate.qml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/application/resources/harmattan/qml/StationScheduleDelegate.qml b/application/resources/harmattan/qml/StationScheduleDelegate.qml index 366be29..79b3981 100644 --- a/application/resources/harmattan/qml/StationScheduleDelegate.qml +++ b/application/resources/harmattan/qml/StationScheduleDelegate.qml @@ -80,8 +80,7 @@ Item { right: bodyRow.right rightMargin: UiConstants.DefaultMargin } - text: qsTr("Platform %1").arg((root.actualPlatform === "--") ? root.expectedPlatfrom : root.actualPlatform) - color: root.actualPlatform === "--" ? "#ddd" : UiConstants.AccentColor + text: displayPlatform(root.expectedPlatfrom, root.actualPlatform) font.bold: UiConstants.SubtitleFontBoldness font.pixelSize: UiConstants.SubtitleFontPixelSize } @@ -101,4 +100,16 @@ Item { console.log(settings.queryBaseUrl + "/" + detailsUrl) } } + function displayPlatform(expected, actual) + { + if (actual === "--") { + return qsTr("Platform %1").arg(expected) + } else if (actual === expected || expected === "--") { + return qsTr("Platform %2").arg(actual) + } else { + return qsTr("Platform " + + "%1 " + + "%2").arg(expected).arg(actual) + } + } } -- 1.7.9.5