1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: MIT
3
4import { Page } from "page.slint";
5import { Usage } from "usage.slint";
6import { OverviewAdapter } from "overview.slint";
7import { BalanceAdapter } from "balance.slint";
8import { UsageAdapter } from "usage.slint";
9import { UsageAdapter } from "usage.slint";
10import { ScrollView, GroupBox, BalanceChart, BarChart, ValueDisplay} from "../widgets/widgets.slint";
11import { ValueTile, BalanceTile, BarChartTile } from "dashboard.slint";
12
13export component DashboardMobile inherits Page {
14 ScrollView {
15 VerticalLayout {
16 alignment: start;
17 spacing: 16px;
18
19 ValueTile {
20 title: OverviewAdapter.production-title;
21 model: OverviewAdapter.production-model;
22 active: root.active;
23 }
24
25 ValueTile {
26 title: OverviewAdapter.self-consumption-title;
27 model: OverviewAdapter.self-consumption-model;
28 alternative-colors: true;
29 active: root.active;
30 }
31
32 GroupBox {
33 title: UsageAdapter.title;
34
35 VerticalLayout {
36 ValueDisplay {
37 model: UsageAdapter.overview-model;
38 transparent-background: true;
39 alternative-colors: true;
40 active: root.active;
41 }
42
43 BarChart {
44 model: UsageAdapter.model;
45 min: UsageAdapter.min;
46 max: UsageAdapter.max;
47 active: root.active;
48 }
49 }
50 }
51
52 GroupBox {
53 title: BalanceAdapter.title;
54
55 BalanceChart {
56 x-axis-model: BalanceAdapter.x-axis-model;
57 y-axis-model: BalanceAdapter.y-axis-model;
58 model: BalanceAdapter.model;
59 min: BalanceAdapter.min;
60 max: BalanceAdapter.max;
61 y-unit: BalanceAdapter.y-unit;
62 active: root.active;
63 min-height: 200px;
64 }
65 }
66 }
67 }
68}