summaryrefslogtreecommitdiff
path: root/navit/gui/qml/skins/navit/PageSearch.qml
blob: 3d9419920cd6870ae25548610f695340718b98fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import Qt 4.7
import "pagenavigation.js" as Navit

Rectangle {
    id: page

    width: gui.width; height: gui.height
    color: "Black"
    opacity: 0

    function pageOpen() {
       if ( search.countryName.length>0 ) {
	    gridCity.opacity = 1;
       }
       if ( search.townName.length>0 ) {
	    gridStreet.opacity = 1;
       }
       if ( search.streetName.length>0 ) {
	    gridAddress.opacity = 0; //Disabled ,because housenamuber search is broken
       }
        page.opacity = 1;
    }
    
    Component.onCompleted: pageOpen();    
    
    Behavior on opacity {
        NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
    }

    Grid {
        columns: 2;rows: 1
        anchors.horizontalCenter: parent.horizontalCenter;
        anchors.bottom: parent.verticalCenter; anchors.bottomMargin: gui.height/16;
        spacing: gui.width/12
	Grid {
	    columns: 1;rows: 2;
	    id: gridCountry;
            Text {
                id: txtItemCountry; text: "Country"; 
	        color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
	    }
            ButtonIcon {
                id: btnCountry; text: search.countryName; icon: "country_"+search.countryISO2+".svgz"; onClicked: { search.searchContext="country"; Navit.load("PageSearchSelector.qml"); }
            }            
	}
	Grid {
	    columns: 1; rows: 2;
	    id: gridCity
	    opacity: 0;
            Text {
                id: txtItemCity; text: "Town"; 
	        color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
	    }
            ButtonIcon {
                id: btnCity; text: search.townName; icon: "gui_bookmark.svg"; onClicked: { search.searchContext="town"; Navit.load("PageSearchSelector.qml"); }
            }
	}
    }

    Grid {
        columns: 2;rows: 1
        anchors.horizontalCenter: parent.horizontalCenter;
        anchors.top: parent.verticalCenter; anchors.topMargin: gui.height/16;
        spacing: gui.width/12
	Grid {
	    columns: 1; rows: 2;
	    id: gridStreet
	    opacity: 0;
            Text {
                id: txtItemStreet; text: "Street"; 
	        color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
	    }
            ButtonIcon {
                id: btnStreet; text: search.streetName; icon: "gui_town.svg"; onClicked: { search.searchContext="street"; Navit.load("PageSearchSelector.qml"); }
            }
       }
       Grid {
           columns: 1; rows: 2;
	   id: gridAddress;
	   opacity: 0;
            Text {
                id: txtItemAddress; text: "Address"; 
	        color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
	    }
            ButtonIcon {
                id: btnAddress; text: "Address"; icon: "attraction.svg"; onClicked: console.log("Implement me!");
            }
	}
    }

    Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
}