warehouse for ces2019
[apps/onscreenapp.git] / app / pages / DetailPage.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
17 import QtQuick 2.6
18 import QtQuick.Layouts 1.1
19 import QtQuick.Controls 2.0
20  
21  Page {
22     id: detailpage
23     visible: true
24
25     property StackView stack: null
26     property var model
27
28     Item {
29         id: backItem
30         width: 80
31         height: 40
32
33         Image {
34             anchors.fill: parent
35             source: 'qrc:/images/Back.svg'
36         }
37
38         MouseArea {
39             anchors.fill: parent
40             onClicked: {
41                 stack.pop(StackView.Immediate)
42             }
43         }
44     }
45
46     RowLayout {
47         id: infoLayout
48
49         height: parent.width / 3
50         width: parent.width
51         anchors.top: backItem.bottom
52         anchors.topMargin: 10
53         
54         spacing: 20
55         
56         Item {
57             Layout.preferredWidth: 200
58             Layout.preferredHeight: 200
59             Image {
60                 anchors.fill: parent
61                 source: model.icon
62             }
63         }
64
65         ColumnLayout {
66             spacing: 5
67             Label {
68                 Layout.fillWidth: true
69                 text: model.name.toUpperCase()
70                 font.pixelSize: 32
71                 color: '#00ADDC'
72             }
73             Label {
74                 text: 'Author: ' + model.author
75                 font.pixelSize: 24
76             }
77             Label {
78                 text: 'Version: ' + model.version
79                 font.pixelSize: 16
80                 font.italic: true
81             }
82             Label {
83                 text: 'Category: ' + model.category
84                 font.pixelSize: 16
85             }
86             Label {
87                 text: 'UpdateTime: ' + new Date(model.createdtime)
88                 font.pixelSize: 16
89             }
90         }
91     }
92
93     Image {
94         id: dividingLine
95         width: parent.width
96         anchors.top: infoLayout.bottom
97         anchors.topMargin: 10
98         anchors.horizontalCenter: parent.horizontalCenter
99         source: 'qrc:/images/DividingLine.svg'
100     }
101
102     Label {
103         width: parent.width
104         anchors.top: dividingLine.bottom
105         anchors.topMargin: 20
106
107         text: model.description
108         wrapMode: Text.Wrap
109         font.pixelSize: 40
110     }
111  }