1786049958
This commit is contained in:
137
ui/main.slint
137
ui/main.slint
@@ -9,6 +9,26 @@ import { Horizontal, Vertical, Switch } from "./material.slint";
|
|||||||
import "./fonts/Roboto-VariableFont.ttf";
|
import "./fonts/Roboto-VariableFont.ttf";
|
||||||
import { FilledIcons, OutlinedIcons } from "./icons.slint";
|
import { FilledIcons, OutlinedIcons } from "./icons.slint";
|
||||||
|
|
||||||
|
component LightSwitch inherits Horizontal {
|
||||||
|
in property <string> text: "";
|
||||||
|
in property <bool> checked: false;
|
||||||
|
in property <bool> enabled: true;
|
||||||
|
|
||||||
|
alignment: end;
|
||||||
|
Text {
|
||||||
|
text: root.text;
|
||||||
|
vertical-alignment: center;
|
||||||
|
horizontal-alignment: right;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: root.checked ? 700 : 500;
|
||||||
|
}
|
||||||
|
Switch {
|
||||||
|
enabled: root.enabled;
|
||||||
|
checked: root.checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// The window the user interacts with. Edits to the inputs propagate to
|
// The window the user interacts with. Edits to the inputs propagate to
|
||||||
// the SystemTrayIcon instance via the host language's callbacks.
|
// the SystemTrayIcon instance via the host language's callbacks.
|
||||||
export component MainWindow inherits Window {
|
export component MainWindow inherits Window {
|
||||||
@@ -101,117 +121,40 @@ export component MainWindow inherits Window {
|
|||||||
|
|
||||||
Vertical {
|
Vertical {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
Horizontal {
|
|
||||||
alignment: end;
|
LightSwitch {
|
||||||
Text {
|
text: "Armory Light";
|
||||||
text: "Armory Light";
|
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
checked: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Horizontal {
|
LightSwitch {
|
||||||
alignment: end;
|
text: "Bedroom Light";
|
||||||
Text {
|
|
||||||
text: "Bedroom Light";
|
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
checked: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Horizontal {
|
LightSwitch {
|
||||||
alignment: end;
|
text: "Hallway Light";
|
||||||
Text {
|
|
||||||
text: "Hallway Light";
|
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
checked: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Horizontal {
|
LightSwitch {
|
||||||
alignment: end;
|
text: "Kitchen Light";
|
||||||
Text {
|
|
||||||
text: "Kitchen Light";
|
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
checked: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Horizontal {
|
LightSwitch {
|
||||||
alignment: end;
|
text: "Living Room Light";
|
||||||
Text {
|
enabled: true;
|
||||||
text: "Living Room Light";
|
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
checked: true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Horizontal {
|
LightSwitch {
|
||||||
alignment: end;
|
text: "Shower Light";
|
||||||
Text {
|
|
||||||
text: "Shower Light";
|
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
checked: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Horizontal {
|
LightSwitch {
|
||||||
alignment: end;
|
text: "Utilities Light";
|
||||||
Text {
|
enabled: false;
|
||||||
text: "Utilities Light";
|
checked: false;
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
enabled: false;
|
|
||||||
checked: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Horizontal {
|
LightSwitch {
|
||||||
alignment: end;
|
text: "WC Light";
|
||||||
Text {
|
|
||||||
text: "WC Light";
|
|
||||||
vertical-alignment: center;
|
|
||||||
horizontal-alignment: right;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
checked: false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user