Additional parameter to WindowManager at application startup
[apps/homescreen.git] / homescreen / qml / StatusArea.qml
1 /*
2  * Copyright (C) 2016 The Qt Company Ltd.
3  * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 import QtQuick 2.2
19 import QtQuick.Layouts 1.1
20 import QtQuick.Controls 1.0
21 import HomeScreen 1.0
22
23 Item {
24     id: root
25     width: 295
26     height: 218
27
28     property date now: new Date
29     Timer {
30         interval: 100; running: true; repeat: true;
31         onTriggered: root.now = new Date
32     }
33
34     RowLayout {
35         anchors.fill: parent
36         spacing: 0
37         Item {
38             Layout.fillWidth: true
39             Layout.fillHeight: true
40             Layout.preferredWidth: 295 - 76
41             ColumnLayout {
42                 anchors.fill: parent
43                 anchors.margins: 40
44                 spacing: 0
45                 Text {
46                     Layout.fillWidth: true
47                     Layout.fillHeight: true
48                     text: Qt.formatDate(now, 'dddd').toUpperCase()
49                     font.family: 'Roboto'
50                     font.pixelSize: 13
51                     color: 'white'
52                     verticalAlignment:  Text.AlignVCenter
53 //                    Rectangle {
54 //                        anchors.fill: parent
55 //                        anchors.margins: 5
56 //                        color: 'red'
57 //                        border.color: 'blue'
58 //                        border.width: 1
59 //                        z: -1
60 //                    }
61                 }
62                 Text {
63                     Layout.fillWidth: true
64                     Layout.fillHeight: true
65                     text: Qt.formatTime(now, 'h:mm ap').toUpperCase()
66                     font.family: 'Roboto'
67                     font.pixelSize: 40
68                     color: 'white'
69                     horizontalAlignment:  Text.AlignHCenter
70                     verticalAlignment:  Text.AlignVCenter
71                 }
72                 RowLayout {
73                     Layout.fillWidth: true
74                     Layout.fillHeight: true
75                     Layout.preferredHeight: 20
76                     Image {
77                         source: './images/Weather/WeatherIcons_Rain-01.png'
78                     }
79                     Text {
80                         text: '64°F'
81                         color: 'white'
82                         font.family: 'Helvetica'
83                         font.pixelSize: 32
84                     }
85                 }
86             }
87         }
88         ColumnLayout {
89             id: icons
90             Layout.fillWidth: true
91             Layout.fillHeight: true
92             Layout.preferredWidth: 76
93             spacing: -10
94             Repeater {
95                 model: StatusBarModel {}
96                 delegate: Image {
97                     Layout.preferredWidth: 77
98                     Layout.preferredHeight: 73
99                     source: model.modelData
100                     fillMode: Image.PreserveAspectFit
101                 }
102             }
103         }
104     }
105 }