slint/demos/energy-monitor/ui/pages/dashboard_mobile.slint
Simon Hausmann a98d4709be Move printer demo and energy-monitor into new top-level demos/ folder
These are showing off use-cases for Slint, but they're not examples showing individual Slint features.

Also removed the old printerdemo while at it.
2024-10-25 12:09:32 +02:00

68 lines
No EOL
2.2 KiB
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import { Page } from "page.slint";
import { Usage } from "usage.slint";
import { OverviewAdapter } from "overview.slint";
import { BalanceAdapter } from "balance.slint";
import { UsageAdapter } from "usage.slint";
import { UsageAdapter } from "usage.slint";
import { ScrollView, GroupBox, BalanceChart, BarChart, ValueDisplay} from "../widgets/widgets.slint";
import { ValueTile, BalanceTile, BarChartTile } from "dashboard.slint";
export component DashboardMobile inherits Page {
ScrollView {
VerticalLayout {
alignment: start;
spacing: 16px;
ValueTile {
title: OverviewAdapter.production-title;
model: OverviewAdapter.production-model;
active: root.active;
}
ValueTile {
title: OverviewAdapter.self-consumption-title;
model: OverviewAdapter.self-consumption-model;
alternative-colors: true;
active: root.active;
}
GroupBox {
title: UsageAdapter.title;
VerticalLayout {
ValueDisplay {
model: UsageAdapter.overview-model;
transparent-background: true;
alternative-colors: true;
active: root.active;
}
BarChart {
model: UsageAdapter.model;
min: UsageAdapter.min;
max: UsageAdapter.max;
active: root.active;
}
}
}
GroupBox {
title: BalanceAdapter.title;
BalanceChart {
x-axis-model: BalanceAdapter.x-axis-model;
y-axis-model: BalanceAdapter.y-axis-model;
model: BalanceAdapter.model;
min: BalanceAdapter.min;
max: BalanceAdapter.max;
y-unit: BalanceAdapter.y-unit;
active: root.active;
min-height: 200px;
}
}
}
}
}