1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: MIT
3import { AppState, WidgetType, ComponentData } from "../../appState.slint";
4import { Lamp } from "../lamp.slint";
5import { Appliance } from "../appliance.slint";
6import { Overhead } from "../overhead.slint";
7import { Info } from "../info.slint";
8import { Graph } from "../graph.slint";
9import { Control } from "../control.slint";
10import { MusicPlayer } from "../musicPlayer.slint";
11import { Camera } from "../camera.slint";
12import { HVAC } from "../hvac.slint";
13import { Alarm } from "../alarm.slint";
14import { Measurements, Animation } from "../../common.slint";
15
16
17export component FullScreenWidgetLoaderSW {
18 in property <int> index;
19 in property <ComponentData> data;
20 property <bool> show: false;
21 property <bool> moveMode: false;
22 in property <bool> skip-initial-fade: false;
23 in property <WidgetType> type;
24
25
26 opacity: 1;
27 x: data.x * AppState.x-scale * 1px;
28 y: data.y * AppState.y-scale * 1px;
29 width: data.width * AppState.x-scale * 1px;
30 height: data.height * AppState.y-scale * 1px;
31 visible: AppState.full-screen-index != -1;
32
33 // Use the correct component based on type
34 if root.type == WidgetType.lamp: Lamp {
35 name: AppState.component-details[root.index].name;
36 id: AppState.component-details[root.index].id;
37 width: root.width;
38 height: root.height;
39 full-screen: true;
40 }
41
42 if root.type == WidgetType.appliance: Appliance {
43 name: AppState.component-details[root.index].name;
44 id: AppState.component-details[root.index].id;
45 width: root.width;
46 height: root.height;
47 full-screen: true;
48 }
49
50 if root.type == WidgetType.overhead: Overhead {
51 name: AppState.component-details[root.index].name;
52 id: AppState.component-details[root.index].id;
53 width: root.width;
54 height: root.height;
55 full-screen: true;
56 }
57
58 if root.type == WidgetType.info: Info {
59 name: AppState.component-details[root.index].name;
60 id: AppState.component-details[root.index].id;
61 width: root.width;
62 height: root.height;
63 full-screen: true;
64 }
65
66 if root.type == WidgetType.graph: Graph {
67 name: AppState.component-details[root.index].name;
68 id: AppState.component-details[root.index].id;
69 width: root.width;
70 height: root.height;
71 full-screen: true;
72 }
73
74 if root.type == WidgetType.control: Control {
75 name: AppState.component-details[root.index].name;
76 id: AppState.component-details[root.index].id;
77 width: root.width;
78 height: root.height;
79 full-screen: true;
80 }
81 if root.type == WidgetType.music: MusicPlayer {
82 name: AppState.component-details[root.index].name;
83 id: AppState.component-details[root.index].id;
84 width: root.width;
85 height: root.height;
86 full-screen: true;
87 }
88 if root.type == WidgetType.hvac: HVAC {
89 name: AppState.component-details[root.index].name;
90 id: AppState.component-details[root.index].id;
91 index: root.index;
92 width: root.width;
93 height: root.height;
94 full-screen: true;
95 }
96 if root.type == WidgetType.camera: Camera {
97 name: AppState.component-details[root.index].name;
98 id: AppState.component-details[root.index].id;
99 width: root.width;
100 height: root.height;
101 full-screen: true;
102 }
103 if root.type == WidgetType.alarm: Alarm {
104 name: AppState.component-details[root.index].name;
105 id: AppState.component-details[root.index].id;
106 width: root.width;
107 height: root.height;
108 full-screen: true;
109 }
110}
111