2023-10-22 22:32:13 +13:00
|
|
|
import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListView, StandardTableView, CheckBox} from "std-widgets.slint";
|
|
|
|
import {SelectableTableView} from "selectable_tree_view.slint";
|
|
|
|
import {LeftSidePanel} from "left_side_panel.slint";
|
2023-10-22 23:18:41 +13:00
|
|
|
import {CurrentTab, TypeOfOpenedItem} from "common.slint";
|
2023-10-22 22:32:13 +13:00
|
|
|
|
|
|
|
export component MainList {
|
2023-10-22 23:18:41 +13:00
|
|
|
callback item_opened(string);
|
2023-10-22 22:32:13 +13:00
|
|
|
in-out property <CurrentTab> active-tab;
|
|
|
|
|
|
|
|
in-out property <[{checked: bool, header_row: bool, selected_row: bool, val:[string]}]> empty_folder_model;
|
|
|
|
in-out property <[{checked: bool, header_row: bool, selected_row: bool, val:[string]}]> empty_files_model;
|
|
|
|
in-out property <[{checked: bool, header_row: bool, selected_row: bool, val:[string]}]> similar_images_model;
|
|
|
|
|
|
|
|
// TODO - using root.active-tab in visible property will not clear model
|
|
|
|
if root.active-tab == CurrentTab.EmptyFolders: SelectableTableView {
|
|
|
|
min-width: 200px;
|
|
|
|
|
|
|
|
columns: ["Selection", "Folder Name", "Path"];
|
|
|
|
last-column: "Modification Date";
|
|
|
|
column-sizes: [30px, 100px, 100px, 100px];
|
|
|
|
values <=> empty-folder-model;
|
2023-10-22 23:18:41 +13:00
|
|
|
parentPathIdx: 2;
|
|
|
|
fileNameIdx: 1;
|
|
|
|
item_opened(item) => {item_opened(item)}
|
2023-10-22 22:32:13 +13:00
|
|
|
}
|
|
|
|
if root.active-tab == CurrentTab.EmptyFiles: SelectableTableView {
|
|
|
|
min-width: 200px;
|
|
|
|
|
|
|
|
columns: ["Selection", "Folder Name", "Path"];
|
|
|
|
last-column: "Modification Date";
|
|
|
|
column-sizes: [30px, 100px, 100px, 100px];
|
|
|
|
values <=> empty-files-model;
|
2023-10-22 23:18:41 +13:00
|
|
|
parentPathIdx: 2;
|
|
|
|
fileNameIdx: 1;
|
|
|
|
item_opened(item) => {item_opened(item)}
|
2023-10-22 22:32:13 +13:00
|
|
|
}
|
|
|
|
if root.active-tab == CurrentTab.SimilarImages: SelectableTableView {
|
|
|
|
min-width: 200px;
|
|
|
|
|
|
|
|
columns: ["Selection", "Folder Name", "Path"];
|
|
|
|
last-column: "Modification Date";
|
|
|
|
column-sizes: [30px, 100px, 100px, 100px];
|
|
|
|
values <=> similar-images-model;
|
2023-10-22 23:18:41 +13:00
|
|
|
parentPathIdx: 2;
|
|
|
|
fileNameIdx: 1;
|
|
|
|
item_opened(item) => {item_opened(item)}
|
2023-10-22 22:32:13 +13:00
|
|
|
}
|
|
|
|
}
|