summaryrefslogtreecommitdiff
path: root/navit/gui/qml/skins/navit/PageNavigate.qml
blob: 3d4e04bc2fd0ff478591a5fb42ed6ab31b7b64f2 (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
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 (point.pointType!="Bookmark") {
	    btnAddBookmark.opacity=1;
	}
	if (point.pointType!="MapPoint") {
	    btnView.opacity=1;
	}
	if (point.pointType!="Position") {
	    btnPosition.opacity=1;
	}
	if (point.pointType!="Destination") {
	    btnDestination.opacity=1;
	}
        page.opacity = 1;
    }
    
    Component.onCompleted: pageOpen();    
    
    Behavior on opacity {
        NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
    }

    Text {
	id: infoTxt;
    	text: point.coordString; color: "White"; font.pointSize: gui.height/20;
	anchors.top:parent.top;anchors.horizontalCenter:parent.horizontalCenter
    }
    Text {
	id: nameTxt;
    	text: point.pointName; color: "White"; font.pointSize: gui.height/20;
	anchors.top:infoTxt.bottom;anchors.topMargin: 5;anchors.horizontalCenter:parent.horizontalCenter
    }

        ButtonIcon {
            id: btnView; text: "View on map"; icon: "gui_maps.svg"; onClicked: { navit.setCenter(); gui.backToMap(); }
	    opacity: 0
	    anchors.top: nameTxt.bottom;anchors.topMargin:gui.height/32
	    anchors.left:page.left;anchors.leftMargin: gui.height/6
        }
        ButtonIcon {
            id: btnPosition; text: "Set as\nposition"; icon: "gui_active.svg"; onClicked: { navit.setPosition(); gui.backToMap() }
	    opacity: 0
	    anchors.top: nameTxt.bottom;anchors.topMargin:gui.height/32
	    anchors.left:btnView.right;anchors.leftMargin: gui.height/6
        }
        ButtonIcon {
            id: btnDestination; text: "Set as\ndestination"; icon: "gui_active.svg"; onClicked: { route.addDestination(); gui.backToMap() }
	    opacity: 0
	    anchors.top: nameTxt.bottom;anchors.topMargin:gui.height/32
	    anchors.left:btnPosition.right;anchors.leftMargin: gui.height/6
        }
        ButtonIcon {
            id: btnAddBookmark; text: "Add as\na bookmark"; icon: "gui_active.svg"; onClicked: Navit.load("PageBookmarksAdd.qml");
	    opacity: 0
	    anchors.top: nameTxt.bottom;anchors.topMargin:gui.height/32
	    anchors.left:btnDestination.right;anchors.leftMargin: gui.height/6
        }
    Grid {
        columns: 4;rows: 1
        anchors.horizontalCenter: parent.horizontalCenter;
	anchors.top: btnDestination.bottom;anchors.topMargin:gui.height/32
        spacing: gui.height/6
        ButtonIcon {
            id: btnBookmarks; text: "Bookmarks"; icon: "gui_bookmark.svg"; onClicked: {bookmarks.moveRoot(); Navit.load("PageBookmarks.qml"); }
        }
        ButtonIcon {
            id: btnPOI; text: "Nearest\nPOIs"; icon: "attraction.svg"; onClicked: Navit.load("PagePoi.qml");
        }
        ButtonIcon {
            id: btnSearch; text: "Address\nSearch"; icon: "gui_town.svg"; onClicked: Navit.load("PageSearch.qml");
        }
        ButtonIcon {
            id: btnInfo; text: "Point\ninformation"; icon: "gui_menu.svg"; onClicked: Navit.load("PagePointInfo.qml");
        }
    }

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