Various improvements to LinePad + UI flow
[pywienerlinien] / qml / main.qml
1 import QtQuick 1.1
2 import com.nokia.meego 1.0
3 import QtMobility.location 1.1
4
5 PageStackWindow {
6     id: appWindow
7
8     initialPage: mainPage
9     showToolBar: aboutBox.opacity == 0
10
11     MainPage {
12         id: mainPage
13
14         AboutBox {
15             id: aboutBox
16             anchors.fill: parent
17
18             appName: aboutInfo.getAppName()
19             websiteURL: aboutInfo.getWebsiteURL()
20             copyright: aboutInfo.getCopyright()
21             license: aboutInfo.getLicense()
22             iconFilename: 'gotovienna-about-logo.png'
23         }
24     }
25
26     PositionSource {
27         id: positionSource
28         updateInterval: 15000
29
30         active: !(position.longitudeValid && position.latitudeValid)
31     }
32
33     ToolBarLayout {
34         id: commonTools
35         ToolIcon {
36             platformIconId: "toolbar-view-menu"
37             anchors.right: parent.right
38             onClicked: menu.open()
39         }
40
41         ToolIcon {
42               visible: mainPage.canRefresh
43               platformIconId: 'icon-m-toolbar-refresh'
44               anchors.centerIn: parent
45               onClicked: mainPage.refresh()
46         }
47
48         Image {
49             id: logo
50             source: 'logo.png'
51
52             anchors {
53                 verticalCenter: parent.verticalCenter
54                 left: parent.left
55                 leftMargin: 10
56             }
57         }
58
59         Text {
60             id: debugText
61             text: ''
62
63             anchors {
64                 bottomMargin: 10
65                 bottom: parent.bottom
66                 left: logo.right
67                 leftMargin: 10
68                 top: logo.top
69             }
70             font.pixelSize: 16
71         }
72     }
73
74     Menu {
75         id: menu
76
77         MenuLayout {
78             MenuItem {
79                 text: 'Nearby stations'
80                 onClicked: mainPage.showNearby()
81             }
82             MenuItem {
83                 text: 'About gotoVienna'
84                 onClicked: aboutBox.show()
85             }
86         }
87     }
88 }