1 |
import Qt 4.7
|
2 |
import "pagenavigation.js" as Navit
|
3 |
|
4 |
Rectangle {
|
5 |
id: page
|
6 |
|
7 |
width: gui.width; height: gui.height
|
8 |
color: "Black"
|
9 |
opacity: 0
|
10 |
|
11 |
function pageOpen() {
|
12 |
if ( search.countryName.length>0 ) {
|
13 |
gridCity.opacity = 1;
|
14 |
}
|
15 |
if ( search.townName.length>0 ) {
|
16 |
gridStreet.opacity = 1;
|
17 |
}
|
18 |
if ( search.streetName.length>0 ) {
|
19 |
gridAddress.opacity = 0; //Disabled ,because housenamuber search is broken
|
20 |
}
|
21 |
page.opacity = 1;
|
22 |
}
|
23 |
|
24 |
Component.onCompleted: pageOpen();
|
25 |
|
26 |
Behavior on opacity {
|
27 |
NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
|
28 |
}
|
29 |
|
30 |
Grid {
|
31 |
columns: 2;rows: 1
|
32 |
anchors.horizontalCenter: parent.horizontalCenter;
|
33 |
anchors.bottom: parent.verticalCenter; anchors.bottomMargin: gui.height/16;
|
34 |
spacing: gui.width/12
|
35 |
Grid {
|
36 |
columns: 1;rows: 2;
|
37 |
id: gridCountry;
|
38 |
Text {
|
39 |
id: txtItemCountry; text: "Country";
|
40 |
color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
|
41 |
}
|
42 |
ButtonIcon {
|
43 |
id: btnCountry; text: search.countryName; icon: "country_"+search.countryISO2+".svgz"; onClicked: { search.searchContext="country"; Navit.load("PageSearchSelector.qml"); }
|
44 |
}
|
45 |
}
|
46 |
Grid {
|
47 |
columns: 1; rows: 2;
|
48 |
id: gridCity
|
49 |
opacity: 0;
|
50 |
Text {
|
51 |
id: txtItemCity; text: "Town";
|
52 |
color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
|
53 |
}
|
54 |
ButtonIcon {
|
55 |
id: btnCity; text: search.townName; icon: "gui_bookmark.svg"; onClicked: { search.searchContext="town"; Navit.load("PageSearchSelector.qml"); }
|
56 |
}
|
57 |
}
|
58 |
}
|
59 |
|
60 |
Grid {
|
61 |
columns: 2;rows: 1
|
62 |
anchors.horizontalCenter: parent.horizontalCenter;
|
63 |
anchors.top: parent.verticalCenter; anchors.topMargin: gui.height/16;
|
64 |
spacing: gui.width/12
|
65 |
Grid {
|
66 |
columns: 1; rows: 2;
|
67 |
id: gridStreet
|
68 |
opacity: 0;
|
69 |
Text {
|
70 |
id: txtItemStreet; text: "Street";
|
71 |
color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
|
72 |
}
|
73 |
ButtonIcon {
|
74 |
id: btnStreet; text: search.streetName; icon: "gui_town.svg"; onClicked: { search.searchContext="street"; Navit.load("PageSearchSelector.qml"); }
|
75 |
}
|
76 |
}
|
77 |
Grid {
|
78 |
columns: 1; rows: 2;
|
79 |
id: gridAddress;
|
80 |
opacity: 0;
|
81 |
Text {
|
82 |
id: txtItemAddress; text: "Address";
|
83 |
color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
|
84 |
}
|
85 |
ButtonIcon {
|
86 |
id: btnAddress; text: "Address"; icon: "attraction.svg"; onClicked: console.log("Implement me!");
|
87 |
}
|
88 |
}
|
89 |
}
|
90 |
|
91 |
Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
|
92 |
}
|