warehouse for ces2019
[apps/onscreenapp.git] / app / main.qml
1 /*
2  * Copyright (C) 2018 The Qt Company Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 import QtQuick 2.6
17 import QtQuick.Controls 2.0
18 import AGL.Demo.Controls 1.0
19 import NativeAppModel 1.0
20 import ServerAppModel 1.0
21
22 import 'pages'
23
24 ApplicationWindow {
25     id: root
26
27     width: 1080 * screenInfo.scale_factor()
28     height: 1487 * screenInfo.scale_factor()
29
30     SwipeView {
31         id: stackLayout
32         anchors.fill: parent
33         currentIndex: tabBar.currentIndex
34
35         ListPage {
36             id: listPage
37
38             model: ServerAppModel {
39                 id: listModel
40             }
41         }
42
43         SearchPage {
44             id: searchPage
45
46             title: 'SearchPage'
47         }
48
49         ManagementPage {
50             id: managementPage
51
52             model: NativeAppModel {
53                 id: managementModel
54             }
55         }
56         
57         Connections {
58             target: managementPage.model
59             onApplistChanged: {
60                 listPage.model.setNativeApplist(applist)
61             } 
62         }
63
64         Component.onCompleted: {
65             listPage.model.getNextPage(0)
66             managementPage.model.refresh()   
67         }
68     }
69
70
71     footer: TabBar {
72         id: tabBar
73         height: 80
74         currentIndex: stackLayout.currentIndex
75
76         TabButton {
77             text: "List"
78             font.pixelSize: 20
79             height: parent.height
80         }
81         TabButton {
82             text: "Search"
83             font.pixelSize: 20
84             height: parent.height
85         }
86         TabButton {
87             text: "Management"
88             font.pixelSize: 20
89             height: parent.height
90         }
91     }
92 }