WIP: add Qt Quick HomeScreen UI
[staging/HomeScreen.git] / HomeScreenNG / qml / StatusArea.qml
1 import QtQuick 2.7
2 import QtQuick.Layouts 1.1
3 import QtQuick.Controls 2.0
4 import HomeScreen 1.0
5
6 Item {
7     id: root
8     width: 295
9     height: 218
10
11     property date now: new Date
12     Timer {
13         interval: 100; running: true; repeat: true;
14         onTriggered: root.now = new Date
15     }
16
17     RowLayout {
18         anchors.fill: parent
19         spacing: 0
20         Item {
21             Layout.fillWidth: true
22             Layout.fillHeight: true
23             Layout.preferredWidth: 295 - 76
24             ColumnLayout {
25                 anchors.fill: parent
26                 anchors.margins: 40
27                 spacing: 0
28                 Label {
29                     Layout.fillWidth: true
30                     Layout.fillHeight: true
31                     text: Qt.formatDate(now, 'dddd').toUpperCase()
32                     font.family: 'Roboto'
33                     font.pixelSize: 13
34                     color: 'white'
35                     verticalAlignment:  Text.AlignVCenter
36 //                    Rectangle {
37 //                        anchors.fill: parent
38 //                        anchors.margins: 5
39 //                        color: 'red'
40 //                        border.color: 'blue'
41 //                        border.width: 1
42 //                        z: -1
43 //                    }
44                 }
45                 Label {
46                     Layout.fillWidth: true
47                     Layout.fillHeight: true
48                     text: Qt.formatTime(now, 'h:mm ap').toUpperCase()
49                     font.family: 'Roboto'
50                     font.pixelSize: 40
51                     color: 'white'
52                     horizontalAlignment:  Text.AlignHCenter
53                     verticalAlignment:  Text.AlignVCenter
54                 }
55                 RowLayout {
56                     Layout.fillWidth: true
57                     Layout.fillHeight: true
58                     Layout.preferredHeight: 20
59                     Image {
60                         source: './images/Weather/WeatherIcons_Rain-01.png'
61                     }
62                     Label {
63                         text: '64°F'
64                         color: 'white'
65                         font.family: 'Helvetica'
66                         font.pixelSize: 32
67                     }
68                 }
69             }
70         }
71         ColumnLayout {
72             id: icons
73             Layout.fillWidth: true
74             Layout.fillHeight: true
75             Layout.preferredWidth: 76
76             spacing: -10
77             Repeater {
78                 model: StatusBarModel {}
79                 delegate: Image {
80                     source: model.modelData
81                     fillMode: Image.PreserveAspectFit
82                 }
83             }
84         }
85     }
86 }