From dd076dce836f0751fe31fae341026aa68b434f23 Mon Sep 17 00:00:00 2001 From: Luciano Montanaro Date: Sun, 11 Dec 2011 21:56:43 +0100 Subject: [PATCH] Use the StationScheduleModel new type property --- .../resources/harmattan/qml/StationPage.qml | 61 ++++++++++++++------ 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/application/resources/harmattan/qml/StationPage.qml b/application/resources/harmattan/qml/StationPage.qml index c49f3ea..48c33e7 100644 --- a/application/resources/harmattan/qml/StationPage.qml +++ b/application/resources/harmattan/qml/StationPage.qml @@ -6,7 +6,6 @@ import "uiconstants.js" as UiConstants Page { property alias name: schedule.name - anchors.fill: parent tools: ToolBarLayout { id: toolBar @@ -16,7 +15,7 @@ Page { PageHeader { id: header anchors.top: parent.top - selectedIndex: settings.showArrivalsPreferred ? 1 : 0 + selectedIndex: schedule.type options: ListModel { id: dialogOptions ListElement { @@ -28,36 +27,39 @@ Page { } } InfoBar { - id: info + id: infoBar anchors.top: header.bottom text: parent.name } - DroppedShadow { - id: shadow - anchors.top: view.top - } Binding { - target: settings - property: "showArrivalsPreferred" - value: header.selectedIndex === 1 ? true : false + target: schedule + property: "type" + value: header.selectedIndex } LabelStyle { id: labelStyle } Item { id: view - anchors.top: info.bottom - x: 16 - y: 16 - width: parent.width - 32 - height: parent.height - + anchors { + top: infoBar.bottom + bottom: parent.bottom + left: parent.left + right: parent.right + } + DroppedShadow { + id: shadow + anchors.top: view.top + } ListView { id: stationScheduleView clip: true visible: false width: parent.width - height: parent.height + anchors { + top: shadow.top + bottom: parent.bottom + } model: schedule delegate: Item { id: listItem @@ -79,9 +81,16 @@ Page { Row { spacing: UiConstants.ButtonSpacing Label { + text: arrivalTime + font.bold: UiConstants.SpecialFontBoldness + font.pixelSize: UiConstants.SpecialFontPixelSize + visible: schedule.type === StationScheduleModel.ArrivalSchedule + } + Label { text: departureTime font.bold: UiConstants.SpecialFontBoldness font.pixelSize: UiConstants.SpecialFontPixelSize + visible: schedule.type === StationScheduleModel.DepartureSchedule } Label { text: train @@ -91,9 +100,16 @@ Page { } } Label { - text: qsTr("per ") + departureStation + text: qsTr("from ") + arrivalStation + font.bold: UiConstants.DefaultFontBoldness + font.pixelSize: UiConstants.DefaultFontPixelSize + visible: schedule.type === StationScheduleModel.ArrivalSchedule + } + Label { + text: qsTr("to ") + departureStation font.bold: UiConstants.DefaultFontBoldness font.pixelSize: UiConstants.DefaultFontPixelSize + visible: schedule.type === StationScheduleModel.DepartureSchedule } Label { text: delay @@ -107,6 +123,13 @@ Page { anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter } + Image { + anchors { + left: parent.left + right: parent.right + } + source: "image://theme/meegotouch-separator-background-horizontal" + } MouseArea { id: mouseArea anchors.fill: background @@ -125,7 +148,7 @@ Page { platformStyle: BusyIndicatorStyle { size: "large" } - anchors.centerIn: view + anchors.centerIn: parent visible: !stationScheduleView.visible running: visible } -- 1.7.9.5