1
0
Fork 0
mirror of synced 2024-05-17 19:03:08 +12:00
This commit is contained in:
Rafał Mikrut 2023-10-27 21:37:51 +02:00
parent 60c5d6727e
commit f128dd6a88
5 changed files with 41 additions and 7 deletions

View file

@ -35,7 +35,7 @@ pub fn connect_scan_button(app: &MainWindow, progress_sender: Sender<ProgressDat
fn scan_empty_folders(a: Weak<MainWindow>, progress_sender: Sender<ProgressData>, stop_receiver: Receiver<()>) {
thread::spawn(move || {
let mut ef = EmptyFolder::new();
ef.set_included_directory(vec![PathBuf::from("/home/rafal")]);
ef.set_included_directory(vec![PathBuf::from("/home/rafal/Desktop")]);
ef.find_empty_folders(Some(&stop_receiver), Some(&progress_sender));
ef.get_empty_folder_list();

View file

@ -0,0 +1,5 @@
export global ColorPalette {
// Tabs at left side
in-out property<color> tab_selected_color: NativeStyleMetrics.dark-color-scheme ? red : blue;
in-out property<color> tab_hovered_color: NativeStyleMetrics.dark-color-scheme ? green : yellow;
}

View file

@ -1,5 +1,6 @@
import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListView, StandardTableView, CheckBox} from "std-widgets.slint";
import {CurrentTab} from "common.slint";
import {ColorPalette} from "color_palette.slint";
component TabItem {
in property <bool> scanning;
@ -7,10 +8,32 @@ component TabItem {
in property <string> text;
in property <CurrentTab> curr_tab;
Button {
enabled: !scanning;
Rectangle {
width: parent.width;
horizontal-stretch: 1.0;
background: touch-area.has-hover ? blue : green;
opacity: 0.05;
touch_area:= TouchArea {
clicked => {
root.active-tab = root.curr-tab;
}
}
}
HorizontalLayout {
width: parent.width;
alignment: LayoutAlignment.end;
Rectangle {
visible: (root.active-tab == root.curr-tab);
width: 5px;
background: ColorPalette.tab_selected_color;
}
}
Text {
text: root.text;
clicked => { root.active-tab = root.curr-tab; }
width: parent.width;
horizontal-alignment: center;
}
}
@ -29,22 +52,25 @@ export component LeftSidePanel {
}
}
VerticalLayout {
spacing: 3px;
// spacing: 3px;
alignment: center;
out property <length> element-size: 25px;
TabItem {
height: parent.element-size;
scanning: scanning;
text: "Empty Folders";
active-tab <=> root.active-tab;
curr_tab: CurrentTab.EmptyFolders;
}
TabItem {
height: parent.element-size;
scanning: scanning;
text: "Empty Files";
active-tab <=> root.active-tab;
curr_tab: CurrentTab.EmptyFiles;
}
TabItem {
height: parent.element-size;
scanning: scanning;
text: "Similar Images";
active-tab <=> root.active-tab;

View file

@ -17,7 +17,7 @@ export component MainList {
columns: ["Selection", "Folder Name", "Path"];
last-column: "Modification Date";
column-sizes: [30px, 100px, 100px, 100px];
column-sizes: [35px, 100px, 350px, 300px];
values <=> empty-folder-model;
parentPathIdx: 2;
fileNameIdx: 1;

View file

@ -0,0 +1,3 @@
export global Settings {
in-out property<color> todo: blue;
}