diff --git a/.github/workflows/linux_cli.yml b/.github/workflows/linux_cli.yml index 70f3c9b..f306f97 100644 --- a/.github/workflows/linux_cli.yml +++ b/.github/workflows/linux_cli.yml @@ -12,7 +12,7 @@ jobs: linux-cli: strategy: matrix: - toolchain: [ stable, 1.70.0 ] + toolchain: [ stable, 1.72.1 ] type: [ release ] runs-on: ubuntu-20.04 steps: diff --git a/.github/workflows/linux_gui.yml b/.github/workflows/linux_gui.yml index 96c8147..bcdd94a 100644 --- a/.github/workflows/linux_gui.yml +++ b/.github/workflows/linux_gui.yml @@ -12,7 +12,7 @@ jobs: linux-gui: strategy: matrix: - toolchain: [ stable, 1.70.0 ] + toolchain: [ stable, 1.72.1 ] type: [ release ] runs-on: ubuntu-22.04 steps: @@ -29,7 +29,7 @@ jobs: env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-C debuginfo=0" - if: ${{ (matrix.type == 'release') && (matrix.toolchain == '1.70.0') }} + if: ${{ (matrix.type == 'release') && (matrix.toolchain == '1.72.1') }} - name: Store Linux GUI Heif uses: actions/upload-artifact@v3 diff --git a/czkawka_cli/Cargo.toml b/czkawka_cli/Cargo.toml index 783596e..2eb75bc 100644 --- a/czkawka_cli/Cargo.toml +++ b/czkawka_cli/Cargo.toml @@ -3,7 +3,7 @@ name = "czkawka_cli" version = "6.1.0" authors = ["Rafał Mikrut "] edition = "2021" -rust-version = "1.70.0" +rust-version = "1.72.1" description = "CLI frontend of Czkawka" license = "MIT" homepage = "https://github.com/qarmin/czkawka" diff --git a/czkawka_core/Cargo.toml b/czkawka_core/Cargo.toml index ba49cc3..b8bc819 100644 --- a/czkawka_core/Cargo.toml +++ b/czkawka_core/Cargo.toml @@ -3,7 +3,7 @@ name = "czkawka_core" version = "6.1.0" authors = ["Rafał Mikrut "] edition = "2021" -rust-version = "1.70.0" +rust-version = "1.72.1" description = "Core of Czkawka app" license = "MIT" homepage = "https://github.com/qarmin/czkawka" diff --git a/czkawka_gui/Cargo.toml b/czkawka_gui/Cargo.toml index 431bdb9..7db4db6 100644 --- a/czkawka_gui/Cargo.toml +++ b/czkawka_gui/Cargo.toml @@ -3,7 +3,7 @@ name = "czkawka_gui" version = "6.1.0" authors = ["Rafał Mikrut "] edition = "2021" -rust-version = "1.70.0" +rust-version = "1.72.1" description = "GTK frontend of Czkawka" license = "MIT" homepage = "https://github.com/qarmin/czkawka" diff --git a/czkawka_slint_gui/icons/logo.png b/czkawka_slint_gui/icons/logo.png new file mode 100644 index 0000000..1064e49 Binary files /dev/null and b/czkawka_slint_gui/icons/logo.png differ diff --git a/czkawka_slint_gui/icons/settings.png b/czkawka_slint_gui/icons/settings.png new file mode 100644 index 0000000..475bd01 Binary files /dev/null and b/czkawka_slint_gui/icons/settings.png differ diff --git a/czkawka_slint_gui/ui/action_buttons.slint b/czkawka_slint_gui/ui/action_buttons.slint new file mode 100644 index 0000000..79095d6 --- /dev/null +++ b/czkawka_slint_gui/ui/action_buttons.slint @@ -0,0 +1,31 @@ +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"; +import {MainList} from "main_lists.slint"; +import {CurrentTab} from "common.slint"; + + +export component ActionButtons { + callback deleted; + callback scanned(CurrentTab); + in-out property scanning; + in-out property active-tab; + + HorizontalBox { + height: 50px; + scan_button:= Button { + enabled: !scanning; + text: "Scan"; + clicked => { + root.scanned(active-tab); + } + } + delete_button:= Button { + enabled: !scanning; + text: "Delete"; + clicked => { + root.deleted(); + } + } + } +} \ No newline at end of file diff --git a/czkawka_slint_gui/ui/left_side_panel.slint b/czkawka_slint_gui/ui/left_side_panel.slint index b3bdef0..d35458a 100644 --- a/czkawka_slint_gui/ui/left_side_panel.slint +++ b/czkawka_slint_gui/ui/left_side_panel.slint @@ -17,28 +17,47 @@ component TabItem { export component LeftSidePanel { in-out property active-tab; in-out property scanning; + width: 120px; VerticalLayout { - width: 120px; - spacing: 3px; - - TabItem { - scanning: scanning; - text: "Empty Folders"; - active-tab <=> root.active-tab; - curr_tab: CurrentTab.EmptyFolders; + spacing: 20px; + Rectangle { + height: 100px; + Image { + width: root.width; + source: @image-url("../icons/logo.png"); + } } - TabItem { - scanning: scanning; - text: "Empty Files"; - active-tab <=> root.active-tab; - curr_tab: CurrentTab.EmptyFiles; + VerticalLayout { + spacing: 3px; + alignment: center; + + TabItem { + scanning: scanning; + text: "Empty Folders"; + active-tab <=> root.active-tab; + curr_tab: CurrentTab.EmptyFolders; + } + TabItem { + scanning: scanning; + text: "Empty Files"; + active-tab <=> root.active-tab; + curr_tab: CurrentTab.EmptyFiles; + } + TabItem { + scanning: scanning; + text: "Similar Images"; + active-tab <=> root.active-tab; + curr_tab: CurrentTab.SimilarImages; + } } - TabItem { - scanning: scanning; - text: "Similar Images"; - active-tab <=> root.active-tab; - curr_tab: CurrentTab.SimilarImages; + HorizontalLayout { + height: 20px; + alignment: end; + Image { + width: 20px; + source: @image-url("../icons/settings.png"); + } } } } \ No newline at end of file diff --git a/czkawka_slint_gui/ui/main_lists.slint b/czkawka_slint_gui/ui/main_lists.slint new file mode 100644 index 0000000..1cc1045 --- /dev/null +++ b/czkawka_slint_gui/ui/main_lists.slint @@ -0,0 +1,38 @@ +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"; +import {CurrentTab} from "common.slint"; + +export component MainList { + in-out property 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; + } + 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; + } + 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; + } +} \ No newline at end of file diff --git a/czkawka_slint_gui/ui/main_window.slint b/czkawka_slint_gui/ui/main_window.slint index 8533755..7d79dd7 100644 --- a/czkawka_slint_gui/ui/main_window.slint +++ b/czkawka_slint_gui/ui/main_window.slint @@ -1,12 +1,17 @@ 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"; +import {MainList} from "main_lists.slint"; import {CurrentTab} from "common.slint"; +import { ActionButtons } from "action_buttons.slint"; export component MainWindow inherits Window { callback deleted; callback scanned(CurrentTab); min-width: 300px; + preferred-width: 1024px; + min-height: 300px; + preferred-height: 600px; in-out property scanning: false; @@ -22,6 +27,22 @@ export component MainWindow inherits Window { {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , + {checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} , {checked: true, selected_row: false, header_row: false, val: ["lokkaler", "/Xd1/Vide2", "01.23.1911"]} ]; in-out property <[{checked: bool, header_row: bool, selected_row: bool, val:[string]}]> empty_files_model: []; @@ -31,53 +52,30 @@ export component MainWindow inherits Window { VerticalBox { HorizontalBox { + vertical-stretch: 1.0; // min-width: 600px; preferred-height: 300px; LeftSidePanel { - max-width: 10px; // Just forces the smallest possible - scanning: root.scanning; + horizontal-stretch: 0.0; + scanning <=> root.scanning; active-tab <=> root.active-tab; } - // 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; - } - if root.active-tab == CurrentTab.EmptyFiles: SelectableTableView { - min-width: 200px; - - columns: ["Selection", "Folder Name", "Path", "Modification Date"]; - values <=> empty-files-model; - } - if root.active-tab == CurrentTab.SimilarImages: SelectableTableView { - min-width: 200px; - - columns: ["Selection", "Folder Name", "Path", "Modification Date"]; - values <=> similar-images-model; + MainList { + horizontal-stretch: 1.0; + active-tab <=> root.active-tab; + empty_folder_model <=> root.empty_folder_model; + empty_files_model <=> root.empty_files_model; + similar_images_model <=> root.similar_images_model; } } - HorizontalBox { - height: 50px; - scan_button:= Button { - enabled: !scanning; - text: "Scan"; - clicked => { - root.scanned(active-tab); - } - } - delete_button:= Button { - enabled: !scanning; - text: "Delete"; - clicked => { - root.deleted(); - } - } + ActionButtons { + vertical-stretch: 0.0; + scanning <=> root.scanning; + active-tab <=> root.active-tab; + deleted => {root.deleted();} + scanned(item) => {root.scanned(item);} } } } diff --git a/czkawka_slint_gui/ui/selectable_tree_view.slint b/czkawka_slint_gui/ui/selectable_tree_view.slint index f2b2cf7..90de282 100644 --- a/czkawka_slint_gui/ui/selectable_tree_view.slint +++ b/czkawka_slint_gui/ui/selectable_tree_view.slint @@ -7,7 +7,7 @@ export component SelectableTableView inherits Rectangle { in-out property <[length]> column_sizes: [200px, 100px, 100px, 100px]; private property <[length]> real_sizes: [0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px,0px]; - private property column_number: 4; + private property column_number: column-sizes.length + 1; in-out property selected_item: -1; @@ -51,8 +51,10 @@ export component SelectableTableView inherits Rectangle { } list_view := ListView { min-width: 100px; + for r[idx] in root.values : Rectangle { height: 30px; + // TODO move this into singleton background: r.header-row ? #888888 : (touch-area.has-hover ? (r.selected_row ? #cccccc : #dddddd) : (r.selected_row ? #cccccc: #dddddd)); // background: touch-area.has-hover ? (selected ? #333333 : #222222) : (selected ? #333333: #222222); diff --git a/instructions/Compilation.md b/instructions/Compilation.md index 2fe33b4..535318f 100644 --- a/instructions/Compilation.md +++ b/instructions/Compilation.md @@ -12,7 +12,7 @@ New versions of GTK fixes some bugs, so e.g. middle button selection will work o | Program | Min | What for | |---------|--------|--------------------------------------------------------------------------------------| -| Rust | 1.70.0 | The minimum version of rust does not depend on anything, so it can change frequently | +| Rust | 1.72.1 | The minimum version of rust does not depend on anything, so it can change frequently | | GTK | 4.6 | Only for the `GTK` backend | #### Debian / Ubuntu