summaryrefslogtreecommitdiff
path: root/navit/gui/qt5_qml/themes/Levy/SearchDrawerMain.qml
blob: 7185eaf97e2548ac4f03b745fe2201c17ebb61fa (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3

import Navit 1.0
import Navit.Recents 1.0
import Navit.Favourites 1.0

Item {
    id: __root
    property int boxRadius : 10

    signal menuItemClicked(var index)
    TabBar {
        id: tabBar
        height: parent.height * 0.1
        anchors.top: parent.top
        anchors.left: parent.left
        anchors.leftMargin: 0
        anchors.right: parent.right
        anchors.rightMargin: 0
        background: Rectangle {
            color: "#00ffffff"
            }

        TabButton {
            id: tabButton
            text: qsTr("Recent")
            font.pointSize: 12
            anchors.top: parent.top
            anchors.topMargin: 0
            anchors.bottom: parent.bottom
            background:  Rectangle {
                color: tabBar.currentIndex === 0 ? "#ffffff" : "#a4a4a4"
                implicitWidth: 100
                implicitHeight: 40
                radius: __root.boxRadius
                anchors.left: parent.left
                anchors.right: parent.right
                height: parent.height + radius
            }
            onCheckedChanged: {
                if(checked){
                    if(locationListLoader !== null) {
                        locationListLoader.sourceComponent = recentsList
                    }
                }
            }
        }

        TabButton {
            id: tabButton1
            text: qsTr("Favourites")
            font.pointSize: 12
            anchors.top: parent.top
            anchors.topMargin: 0
            anchors.bottom: parent.bottom
            background: Rectangle {
                color: tabBar.currentIndex === 1 ? "#ffffff" : "#a4a4a4"
                implicitWidth: 100
                implicitHeight: 40
                radius: __root.boxRadius
                anchors.left: parent.left
                anchors.right: parent.right
                height: parent.height + radius
            }
            onCheckedChanged: {
                if(checked){
                    if(typeof(locationListLoader.status) != "null") {
                        locationListLoader.sourceComponent = favouritesList
                    }

                }
            }
        }
    }

    Item {
        clip: true
        anchors.top: tabBar.bottom
        anchors.right: parent.right
        anchors.rightMargin: 0
        anchors.left: parent.left
        anchors.leftMargin: 0
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 0
        Rectangle {
            color: "#ffffff"
            radius: __root.boxRadius
            anchors.fill: parent

            Rectangle {
                x: tabBar.currentIndex === 1 ? width : 0
                width: parent.width / 2
                color: "#ffffff"
                anchors.bottomMargin: parent.radius
                anchors.bottom: parent.bottom
                anchors.top: parent.top
                anchors.topMargin: 0
            }
        }
        Loader {
            id:locationListLoader
            anchors.fill: parent
            anchors.topMargin: parent.height * 0.05
            anchors.bottomMargin: parent.height * 0.05
            anchors.leftMargin: parent.width * 0.05
            anchors.rightMargin: parent.width * 0.05
            sourceComponent: recentsList
        }
    }

    Component {
        id:recentsList
        SearchDrawerRecentsList {
        }
    }

    Component {
        id:favouritesList
        SearchDrawerFavouritesList {
        }
    }
}



/*##^## Designer {
    D{i:0;autoSize:true;height:480;width:640}
}
 ##^##*/