1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: MIT |
3 | |
4 | /* |
5 | The design from this file is inspired from the design in |
6 | https://github.com/peter-ha/qskinny/tree/iot-dashboard/examples/iotdashboard |
7 | Original license: |
8 | /**************************************************************************** |
9 | ** |
10 | ** Copyright 2021 Edelhirsch Software GmbH. All rights reserved. |
11 | ** |
12 | ** Redistribution and use in source and binary forms, with or without |
13 | ** modification, are permitted provided that the following conditions are |
14 | ** met: |
15 | ** |
16 | ** * Redistributions of source code must retain the above copyright |
17 | ** notice, this list of conditions and the following disclaimer. |
18 | ** * Redistributions in binary form must reproduce the above copyright |
19 | ** notice, this list of conditions and the following disclaimer in |
20 | ** the documentation and/or other materials provided with the |
21 | ** distribution. |
22 | ** * Neither the name of the copyright holder nor the names of its |
23 | ** contributors may be used to endorse or promote products derived |
24 | ** from this software without specific prior written permission. |
25 | ** |
26 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
27 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
28 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
29 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
30 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
31 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
32 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
33 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
34 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
35 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
36 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
37 | ** |
38 | ****************************************************************************/ |
39 | */ |
40 | |
41 | import { MenuBar, TopBar, Usage, IndoorTemperature, Humidity, MyDevices, |
42 | UsageDiagram, LightIntensity, Clock |
43 | } from "iot-dashboard.slint" ; |
44 | |
45 | |
46 | component MainContent inherits VerticalLayout { |
47 | spacing: 24px; |
48 | TopBar { |
49 | Clock { |
50 | } |
51 | } |
52 | |
53 | GridLayout { |
54 | spacing: 6px; |
55 | padding-left: 19px; |
56 | padding-top: 0px; |
57 | padding-right: 17px; |
58 | padding-bottom: 24px; |
59 | |
60 | Usage { |
61 | rowspan: 2; |
62 | } |
63 | IndoorTemperature { |
64 | row: 0; col: 1; |
65 | } |
66 | Humidity { |
67 | row: 1; col: 1; |
68 | } |
69 | MyDevices { |
70 | row: 0; col: 2; |
71 | rowspan: 2; |
72 | } |
73 | UsageDiagram { |
74 | row: 2; col: 0; |
75 | colspan: 2; |
76 | } |
77 | LightIntensity { |
78 | row: 2; col: 2; |
79 | } |
80 | } |
81 | } |
82 | |
83 | component MainWindow inherits Window { |
84 | title: "IOT dashboard" ; |
85 | HorizontalLayout { |
86 | padding: 0; spacing: 0; |
87 | MenuBar {} |
88 | MainContent {} |
89 | } |
90 | } |
91 | |