Refactor the whole structure, no more separation for C++ and Slint files

This commit is contained in:
Vyn 2024-11-04 14:45:27 +01:00
parent d6c781faa2
commit 893fcc11e3
35 changed files with 920 additions and 518 deletions

View file

@ -0,0 +1,65 @@
import { AppWindowModels, TaskData } from "../Models.slint";
import { AppWindowActions } from "../Actions.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 => { AppWindowActions.open-add-source-window() }
}
}
VerticalLayout {
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) }
}
for item[index] in AppWindowModels.sources-selected: ToggleButton {
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) }
}
}
}
VerticalLayout {
spacing: 4px;
/*VButton {
icon-svg: Svg.cog;
text: "Settings";
background: transparent;
clicked => { AppWindowModels.open-settings-window() }
}*/
}
}
}
}