2024-08-16 21:35:12 +02:00
|
|
|
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;
|
2024-09-02 11:52:06 +02:00
|
|
|
for item[index] in Backend.sources: ToggleButton {
|
2024-08-16 21:35:12 +02:00
|
|
|
text: item;
|
|
|
|
text-alignment: left;
|
|
|
|
clicked => { Backend.source_clicked(index) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*VText {
|
|
|
|
text: "Tags";
|
|
|
|
font-size: 1.5rem;
|
|
|
|
}
|
|
|
|
VerticalLayout {
|
|
|
|
spacing: 4px;
|
|
|
|
for item[index] in Backend.tags: ToggleButton {
|
|
|
|
text: item;
|
|
|
|
text-alignment: left;
|
|
|
|
clicked => { Backend.tag_clicked(index) }
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
}
|