2024-10-15 16:41:22 +02:00
|
|
|
import { Backend } from "../Backend.slint";
|
2024-10-29 15:02:46 +01:00
|
|
|
import { VButton, ToggleButton, VText, Svg, 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 {
|
2024-10-29 15:02:46 +01:00
|
|
|
height: parent.height;
|
2024-08-16 21:35:12 +02:00
|
|
|
padding: 16px;
|
|
|
|
spacing: 16px;
|
|
|
|
VText {
|
|
|
|
text: "Sources";
|
|
|
|
font-size: 1.5rem;
|
|
|
|
}
|
|
|
|
VerticalLayout {
|
2024-10-29 15:02:46 +01:00
|
|
|
alignment: space-between;
|
|
|
|
vertical-stretch: 1;
|
|
|
|
VerticalLayout {
|
|
|
|
vertical-stretch: 1;
|
|
|
|
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) }
|
|
|
|
}
|
2024-08-16 21:35:12 +02:00
|
|
|
}
|
2024-10-29 15:02:46 +01:00
|
|
|
/*VerticalLayout {
|
|
|
|
spacing: 4px;
|
|
|
|
VButton {
|
|
|
|
icon-svg: Svg.cog;
|
|
|
|
text: "Settings";
|
|
|
|
background: transparent;
|
|
|
|
clicked => { Backend.settings-clicked() }
|
|
|
|
}
|
|
|
|
}*/
|
2024-08-16 21:35:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|