From 0b800e86256d72a4be74dd64b695ed8c432f87ba Mon Sep 17 00:00:00 2001 From: Luciano Montanaro Date: Sun, 31 Jul 2011 00:49:04 +0200 Subject: [PATCH] Moved header title update to PageHeader Component --- application/resources/harmattan/qml/PageHeader.qml | 9 +++++++++ .../resources/harmattan/qml/StationListPage.qml | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/application/resources/harmattan/qml/PageHeader.qml b/application/resources/harmattan/qml/PageHeader.qml index 763e7c7..4aba89f 100644 --- a/application/resources/harmattan/qml/PageHeader.qml +++ b/application/resources/harmattan/qml/PageHeader.qml @@ -59,4 +59,13 @@ Rectangle { id: dialog titleText: qsTr("Show") } + onSelectedIndexChanged: { + console.log("Selection changed to: " + selectedIndex) + if (options === undefined || options.count === 0) { + header.text = " " + } else { + header.text = options.get(selectedIndex).name + console.log("Selection text is: " + header.text) + } + } } diff --git a/application/resources/harmattan/qml/StationListPage.qml b/application/resources/harmattan/qml/StationListPage.qml index e45f3f1..a7a3ed4 100644 --- a/application/resources/harmattan/qml/StationListPage.qml +++ b/application/resources/harmattan/qml/StationListPage.qml @@ -46,7 +46,6 @@ Page { PageHeader { id: header anchors.top: parent.top - text: qsTr("Stations") selectedIndex: stationListProxyModel.sortingMode options: ListModel { id: dialogOptions @@ -60,11 +59,6 @@ Page { name: QT_TR_NOOP("Stations Recently Seen") } } - onSelectedIndexChanged: { - header.text = dialogOptions.get(selectedIndex).name - console.log("Selection changed to: " + selectedIndex) - console.log("Selection text is: " + header.text) - } } SearchBar { id: searchField -- 1.7.9.5