mirai/ui/components/SideBar.slint

64 lines
1.4 KiB
Text

import { Backend } from "../Backend.slint";
import { VButton, ToggleButton, VActionButton, VText, Svg, Palette } from "@selenite";
export component SideBar inherits Rectangle {
background: Palette.pane;
VerticalLayout {
height: parent.height;
padding: 16px;
spacing: 16px;
HorizontalLayout {
alignment: space-between;
spacing: 64px;
VText {
text: "Sources";
font-size: 1.5rem;
}
VActionButton {
icon-svg: Svg.plus;
icon-colorize: Palette.green;
background: transparent;
clicked => { Backend.add-source-clicked() }
}
}
VerticalLayout {
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) }
VActionButton {
visible: parent.active;
icon-svg: Svg.cog;
background: transparent;
clicked => { Backend.edit-source-clicked(item.id) }
}
}
}
VerticalLayout {
spacing: 4px;
/*VButton {
icon-svg: Svg.cog;
text: "Settings";
background: transparent;
clicked => { Backend.settings-clicked() }
}*/
}
}
}
}