mirai/src/windows/AppWindow/views/SideBar.slint

66 lines
1.6 KiB
Text
Raw Normal View History

import { AppWindowModels, TaskData } from "../Models.slint";
import { AppWindowActions } from "../Actions.slint";
import { VButton, ToggleButton, VActionButton, VText, Svg, Palette } from "@selenite";
2024-08-16 21:35:12 +02:00
export component SideBar inherits Rectangle {
background: Palette.pane;
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;
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 => { AppWindowActions.open-add-source-window() }
}
2024-08-16 21:35:12 +02:00
}
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: AppWindowModels.no-source-selected;
clicked => { AppWindowActions.source-clicked(-1) }
2024-10-29 15:02:46 +01:00
}
for item[index] in AppWindowModels.sources-selected: ToggleButton {
2024-10-29 15:02:46 +01:00
text: item.name;
text-alignment: left;
active: item.selected;
clicked => { AppWindowActions.source-clicked(item.id) }
VActionButton {
visible: parent.active;
icon-svg: Svg.cog;
background: transparent;
clicked => { AppWindowActions.open-edit-source-window(item.id) }
}
2024-10-29 15:02:46 +01:00
}
2024-08-16 21:35:12 +02:00
}
VerticalLayout {
2024-10-29 15:02:46 +01:00
spacing: 4px;
/*VButton {
2024-10-29 15:02:46 +01:00
icon-svg: Svg.cog;
text: "Settings";
background: transparent;
clicked => { AppWindowModels.open-settings-window() }
}*/
}
2024-08-16 21:35:12 +02:00
}
}
}