mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
31 lines
690 B
Text
31 lines
690 B
Text
import { Backend } from "../Backend.slint";
|
|
import { ToggleButton, VText, Palette } from "@vynui";
|
|
|
|
export component SideBar inherits Rectangle {
|
|
background: Palette.pane;
|
|
|
|
VerticalLayout {
|
|
alignment: start;
|
|
padding: 16px;
|
|
spacing: 16px;
|
|
VText {
|
|
text: "Sources";
|
|
font-size: 1.5rem;
|
|
}
|
|
VerticalLayout {
|
|
spacing: 4px;
|
|
ToggleButton {
|
|
text: "All";
|
|
text-alignment: left;
|
|
active: Backend.no-source-selected;
|
|
clicked => { Backend.source-clicked(-1) }
|
|
}
|
|
for item[index] in Backend.sources-selected: ToggleButton {
|
|
text: item.name;
|
|
text-alignment: left;
|
|
active: item.selected;
|
|
clicked => { Backend.source-clicked(index) }
|
|
}
|
|
}
|
|
}
|
|
}
|