2023-10-18 08:31:08 +13:00
|
|
|
import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListView, StandardTableView, CheckBox} from "std-widgets.slint";
|
|
|
|
import {SelectableTableView} from "selectable_tree_view.slint";
|
|
|
|
|
|
|
|
enum CurrentTab {
|
|
|
|
EmptyFolders,
|
|
|
|
SimilarImages,
|
|
|
|
}
|
|
|
|
|
|
|
|
export component MainWindow {
|
2023-10-20 08:39:48 +13:00
|
|
|
callback deleted;
|
2023-10-18 08:31:08 +13:00
|
|
|
in-out property <CurrentTab> active-tab;
|
2023-10-20 08:39:48 +13:00
|
|
|
in-out property <[{checked: bool, selected_row: bool, val:[string]}]> empty-folder-model: [
|
|
|
|
{checked: false, selected_row: false, val: ["kropkarz", "/Xd1", "24.10.2023"]} ,
|
|
|
|
{checked: false, selected_row: true, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} ,
|
|
|
|
{checked: true, selected_row: false, val: ["lokkaler", "/Xd1/Vide2", "01.23.1911"]} ,
|
2023-10-19 20:32:37 +13:00
|
|
|
];
|
|
|
|
|
|
|
|
min-width: 200px;
|
2023-10-18 08:31:08 +13:00
|
|
|
VerticalBox {
|
|
|
|
HorizontalBox {
|
2023-10-19 20:32:37 +13:00
|
|
|
// min-width: 600px;
|
2023-10-18 08:31:08 +13:00
|
|
|
preferred-height: 300px;
|
|
|
|
|
|
|
|
tab_bar := VerticalLayout {
|
|
|
|
width: 120px;
|
|
|
|
spacing: 3px;
|
|
|
|
Button {
|
|
|
|
text: "Empty Folders";
|
|
|
|
clicked => { root.active-tab = CurrentTab.EmptyFolders; }
|
|
|
|
}
|
|
|
|
Button {
|
|
|
|
text: "Similar Images";
|
|
|
|
clicked => { root.active-tab = CurrentTab.SimilarImages; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO - using root.active-tab in visible property will not
|
|
|
|
if root.active-tab == CurrentTab.EmptyFolders: SelectableTableView {
|
2023-10-19 20:32:37 +13:00
|
|
|
min-width: 200px;
|
|
|
|
|
2023-10-18 08:31:08 +13:00
|
|
|
columns: ["Selection", "Folder Name", "Path", "Modification Date"];
|
2023-10-19 20:32:37 +13:00
|
|
|
values: empty-folder-model;
|
2023-10-18 08:31:08 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
HorizontalBox {
|
|
|
|
scan_button:= Button {
|
|
|
|
text: "Scan";
|
|
|
|
}
|
|
|
|
delete_button:= Button {
|
|
|
|
text: "Delete";
|
2023-10-20 08:39:48 +13:00
|
|
|
clicked => {
|
|
|
|
root.deleted();
|
|
|
|
}
|
2023-10-18 08:31:08 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|