1
0
Fork 0
mirror of synced 2024-05-17 19:03:08 +12:00
This commit is contained in:
Rafał Mikrut 2023-10-28 18:20:46 +02:00
parent f128dd6a88
commit 230ac9d6c7
6 changed files with 61 additions and 28 deletions

View file

@ -0,0 +1,20 @@
# NAME_TODO
NAME_TODO is new Czkawka frontend written in Slint(written mostly in Rust) in opposite to Gtk 4 frontend which uses mostly C code.
Different
## Requirements
Slint version of app should not have any special runtime requirements - it should work on almost any OpenGL 3 capable device.
Alternatively, it can be run with software rendering.
## Compilation
Default compilation is done by `cargo build --release`.
All dependencies should be handled by cargo, except windows where you need to install m.
The only exception is building skia frontend, that require

View file

@ -1,5 +1,12 @@
import { StyleMetrics } from "std-widgets.slint";
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;
in-out property<color> tab_selected_color: StyleMetrics.dark-color-scheme ? red : blue;
in-out property<color> tab_hovered_color: StyleMetrics.dark-color-scheme ? green : yellow;
// ListView
in-out property<color> list_view_normal_color: StyleMetrics.dark-color-scheme ? #474747 : #dddddd;
in-out property<color> list_view_normal_header_color: StyleMetrics.dark-color-scheme ? #292929 : #888888;
in-out property<color> list_view_normal_selected_header: StyleMetrics.dark-color-scheme ? #575757 : #cccccc;
}

View file

@ -13,4 +13,11 @@ export struct ProgressToSend {
current_progress: int,
all_progress: int,
step_name: string,
}
export struct MainListModel {
checked: bool,
header_row: bool,
selected: bool,
data: [string]
}

View file

@ -12,7 +12,7 @@ component TabItem {
Rectangle {
width: parent.width;
horizontal-stretch: 1.0;
background: touch-area.has-hover ? blue : green;
background: touch-area.has-hover ? ColorPalette.tab-hovered-color : transparent;
opacity: 0.05;
touch_area:= TouchArea {

View file

@ -2,12 +2,13 @@ import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListV
import {SelectableTableView} from "selectable_tree_view.slint";
import {LeftSidePanel} from "left_side_panel.slint";
import {CurrentTab, TypeOfOpenedItem} from "common.slint";
import {MainListModel} from "common.slint";
export component MainList {
callback item_opened(string);
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 <[MainListModel]> 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;
@ -23,26 +24,26 @@ export component MainList {
fileNameIdx: 1;
item_opened(item) => {item_opened(item)}
}
if root.active-tab == CurrentTab.EmptyFiles: SelectableTableView {
min-width: 200px;
// 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;
parentPathIdx: 2;
fileNameIdx: 1;
item_opened(item) => {item_opened(item)}
}
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 <=> empty-files-model;
// parentPathIdx: 2;
// fileNameIdx: 1;
// item_opened(item) => {item_opened(item)}
// }
// 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;
parentPathIdx: 2;
fileNameIdx: 1;
item_opened(item) => {item_opened(item)}
}
// columns: ["Selection", "Folder Name", "Path"];
// last-column: "Modification Date";
// column-sizes: [30px, 100px, 100px, 100px];
// values <=> similar-images-model;
// parentPathIdx: 2;
// fileNameIdx: 1;
// item_opened(item) => {item_opened(item)}
// }
}

View file

@ -1,5 +1,6 @@
import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListView, StandardTableView, CheckBox} from "std-widgets.slint";
import {TypeOfOpenedItem} from "common.slint";
import {ColorPalette} from "color_palette.slint";
export component SelectableTableView inherits Rectangle {
callback item_opened(string);
@ -75,10 +76,7 @@ export component SelectableTableView inherits Rectangle {
for r[idx] in root.values : Rectangle {
forward-focus: focus-item;
height: 20px;
// 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);
background: r.header-row ? ColorPalette.list_view_normal_header_color : (touch-area.has-hover ? (r.selected_row ? ColorPalette.list-view-normal-selected-header : ColorPalette.list_view_normal_color) : (r.selected_row ? ColorPalette.list-view-normal-selected-header: ColorPalette.list_view_normal_color));
touch_area:= TouchArea {
forward-focus: focus-item;
clicked => {