2024-10-15 16:41:22 +02:00
|
|
|
import { Backend } from "../Backend.slint";
|
2024-10-16 11:54:15 +02:00
|
|
|
import { ToggleButton, VText, Palette } from "@selenite";
|
2024-08-16 21:35:12 +02:00
|
|
|
|
|
|
|
export component SideBar inherits Rectangle {
|
|
|
|
background: Palette.pane;
|
2024-10-09 17:07:17 +02:00
|
|
|
|
2024-08-16 21:35:12 +02:00
|
|
|
VerticalLayout {
|
|
|
|
alignment: start;
|
|
|
|
padding: 16px;
|
|
|
|
spacing: 16px;
|
|
|
|
VText {
|
|
|
|
text: "Sources";
|
|
|
|
font-size: 1.5rem;
|
|
|
|
}
|
|
|
|
VerticalLayout {
|
|
|
|
spacing: 4px;
|
2024-10-09 17:07:17 +02:00
|
|
|
ToggleButton {
|
|
|
|
text: "All";
|
|
|
|
text-alignment: left;
|
|
|
|
active: Backend.no-source-selected;
|
2024-10-15 16:41:22 +02:00
|
|
|
clicked => { Backend.source-clicked(-1) }
|
2024-10-09 17:07:17 +02:00
|
|
|
}
|
|
|
|
for item[index] in Backend.sources-selected: ToggleButton {
|
|
|
|
text: item.name;
|
2024-08-16 21:35:12 +02:00
|
|
|
text-alignment: left;
|
2024-10-09 17:07:17 +02:00
|
|
|
active: item.selected;
|
2024-10-15 16:41:22 +02:00
|
|
|
clicked => { Backend.source-clicked(index) }
|
2024-08-16 21:35:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|