Formatter
This commit is contained in:
parent
812164bce9
commit
a0e151e5fe
|
@ -7,11 +7,9 @@ import {BottomPanelVisibility} from "common.slint";
|
||||||
export component VisibilityButton inherits Button {
|
export component VisibilityButton inherits Button {
|
||||||
in-out property <BottomPanelVisibility> button_visibility;
|
in-out property <BottomPanelVisibility> button_visibility;
|
||||||
in-out property <BottomPanelVisibility> bottom_panel_visibility;
|
in-out property <BottomPanelVisibility> bottom_panel_visibility;
|
||||||
|
|
||||||
enabled: bottom_panel_visibility != button-visibility;
|
enabled: bottom_panel_visibility != button-visibility;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 70px;
|
width: 70px;
|
||||||
|
|
||||||
clicked => {
|
clicked => {
|
||||||
bottom-panel-visibility = button_visibility;
|
bottom-panel-visibility = button_visibility;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +19,6 @@ export component ActionButtons inherits HorizontalLayout {
|
||||||
callback deleted;
|
callback deleted;
|
||||||
callback scan_stopping;
|
callback scan_stopping;
|
||||||
callback scan_starting(CurrentTab);
|
callback scan_starting(CurrentTab);
|
||||||
|
|
||||||
in-out property <BottomPanelVisibility> bottom_panel_visibility: BottomPanelVisibility.Directories;
|
in-out property <BottomPanelVisibility> bottom_panel_visibility: BottomPanelVisibility.Directories;
|
||||||
in-out property <bool> stop_requested: false;
|
in-out property <bool> stop_requested: false;
|
||||||
in-out property <bool> scanning;
|
in-out property <bool> scanning;
|
||||||
|
@ -29,8 +26,7 @@ export component ActionButtons inherits HorizontalLayout {
|
||||||
out property <int> name;
|
out property <int> name;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
spacing: 4px;
|
spacing: 4px;
|
||||||
|
scan_button := Button {
|
||||||
scan_button:= Button {
|
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
enabled: !scanning;
|
enabled: !scanning;
|
||||||
text: "Scan";
|
text: "Scan";
|
||||||
|
@ -39,7 +35,8 @@ export component ActionButtons inherits HorizontalLayout {
|
||||||
root.scan_starting(active-tab);
|
root.scan_starting(active-tab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stop_button:= Button {
|
|
||||||
|
stop_button := Button {
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
enabled: scanning && !stop_requested;
|
enabled: scanning && !stop_requested;
|
||||||
text: "Stop";
|
text: "Stop";
|
||||||
|
@ -53,7 +50,7 @@ export component ActionButtons inherits HorizontalLayout {
|
||||||
horizontal-stretch: 0.5;
|
horizontal-stretch: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_button:= Button {
|
delete_button := Button {
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
enabled: !scanning;
|
enabled: !scanning;
|
||||||
text: "Delete";
|
text: "Delete";
|
||||||
|
@ -61,7 +58,7 @@ export component ActionButtons inherits HorizontalLayout {
|
||||||
root.deleted();
|
root.deleted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
horizontal-stretch: 0.5;
|
horizontal-stretch: 0.5;
|
||||||
}
|
}
|
||||||
|
@ -90,4 +87,4 @@ export component ActionButtons inherits HorizontalLayout {
|
||||||
text: "None";
|
text: "None";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import {Callabler} from "callabler.slint";
|
||||||
component DirectoriesPanel {
|
component DirectoriesPanel {
|
||||||
callback folder-choose-requested(bool);
|
callback folder-choose-requested(bool);
|
||||||
callback show_manual_add_dialog(bool);
|
callback show_manual_add_dialog(bool);
|
||||||
|
|
||||||
// Included directories
|
// Included directories
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
|
@ -18,22 +17,26 @@ component DirectoriesPanel {
|
||||||
folder-choose-requested(true);
|
folder-choose-requested(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Remove";
|
text: "Remove";
|
||||||
clicked => {
|
clicked => {
|
||||||
Callabler.remove_item_directories(true, included-list.current-item);
|
Callabler.remove_item_directories(true, included-list.current-item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Manual Add";
|
text: "Manual Add";
|
||||||
clicked => {
|
clicked => {
|
||||||
show_manual_add_dialog(true);
|
show_manual_add_dialog(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
vertical-stretch: 1.0;
|
vertical-stretch: 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
horizontal-stretch: 1.0;
|
horizontal-stretch: 1.0;
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -41,6 +44,7 @@ component DirectoriesPanel {
|
||||||
text: "Included Directories";
|
text: "Included Directories";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
included_list := StandardListView {
|
included_list := StandardListView {
|
||||||
model: Settings.included-directories;
|
model: Settings.included-directories;
|
||||||
}
|
}
|
||||||
|
@ -55,22 +59,26 @@ component DirectoriesPanel {
|
||||||
folder-choose-requested(false);
|
folder-choose-requested(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Remove";
|
text: "Remove";
|
||||||
clicked => {
|
clicked => {
|
||||||
Callabler.remove_item_directories(false, excluded-list.current-item);
|
Callabler.remove_item_directories(false, excluded-list.current-item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Manual Add";
|
text: "Manual Add";
|
||||||
clicked => {
|
clicked => {
|
||||||
show_manual_add_dialog(false);
|
show_manual_add_dialog(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
vertical-stretch: 1.0;
|
vertical-stretch: 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
horizontal-stretch: 1.0;
|
horizontal-stretch: 1.0;
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -78,6 +86,7 @@ component DirectoriesPanel {
|
||||||
text: "Excluded Directories";
|
text: "Excluded Directories";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
excluded_list := StandardListView {
|
excluded_list := StandardListView {
|
||||||
model: Settings.excluded-directories;
|
model: Settings.excluded-directories;
|
||||||
}
|
}
|
||||||
|
@ -89,26 +98,26 @@ component TextErrorsPanel inherits TextEdit {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
read-only: true;
|
read-only: true;
|
||||||
text <=> Settings.info_text;
|
text <=> Settings.info_text;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export component BottomPanel {
|
export component BottomPanel {
|
||||||
in-out property <BottomPanelVisibility> bottom_panel_visibility: BottomPanelVisibility.Directories;
|
in-out property <BottomPanelVisibility> bottom_panel_visibility: BottomPanelVisibility.Directories;
|
||||||
|
|
||||||
callback folder-choose-requested(bool);
|
callback folder-choose-requested(bool);
|
||||||
callback show_manual_add_dialog(bool);
|
callback show_manual_add_dialog(bool);
|
||||||
|
|
||||||
min-height: bottom-panel-visibility == BottomPanelVisibility.NotVisible ? 0px : 150px;
|
min-height: bottom-panel-visibility == BottomPanelVisibility.NotVisible ? 0px : 150px;
|
||||||
min-width: bottom-panel-visibility == BottomPanelVisibility.NotVisible ? 0px : 400px;
|
min-width: bottom-panel-visibility == BottomPanelVisibility.NotVisible ? 0px : 400px;
|
||||||
|
|
||||||
if bottom-panel-visibility == BottomPanelVisibility.Directories: DirectoriesPanel {
|
if bottom-panel-visibility == BottomPanelVisibility.Directories: DirectoriesPanel {
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
folder-choose-requested(included-directories) => {root.folder-choose-requested(included-directories)}
|
folder-choose-requested(included-directories) => {
|
||||||
show_manual_add_dialog(included-directories) => {root.show_manual_add_dialog(included-directories)}
|
root.folder-choose-requested(included-directories)
|
||||||
|
}
|
||||||
|
show_manual_add_dialog(included-directories) => {
|
||||||
|
root.show_manual_add_dialog(included-directories)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if bottom-panel-visibility == BottomPanelVisibility.TextErrors : TextErrorsPanel {
|
if bottom-panel-visibility == BottomPanelVisibility.TextErrors: TextErrorsPanel {
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
height: parent.height;
|
height: parent.height;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export global Callabler {
|
export global Callabler {
|
||||||
callback remove_item_directories(bool, int);
|
callback remove_item_directories(bool, int);
|
||||||
callback added_manual_directories(bool, string);
|
callback added_manual_directories(bool, string);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,12 @@ import { StyleMetrics } from "std-widgets.slint";
|
||||||
|
|
||||||
export global ColorPalette {
|
export global ColorPalette {
|
||||||
// Tabs at left side
|
// Tabs at left side
|
||||||
in-out property<color> tab_selected_color: StyleMetrics.dark-color-scheme ? #353535 : #5e5e5e;
|
in-out property <color> tab_selected_color: StyleMetrics.dark-color-scheme ? #353535 : #5e5e5e;
|
||||||
in-out property<color> tab_hovered_color: StyleMetrics.dark-color-scheme ? #49494926 : #80808014;
|
in-out property <color> tab_hovered_color: StyleMetrics.dark-color-scheme ? #49494926 : #80808014;
|
||||||
|
|
||||||
// ListView
|
// ListView
|
||||||
in-out property<color> list_view_normal_color: StyleMetrics.dark-color-scheme ? #222222 : #dddddd;
|
in-out property <color> list_view_normal_color: StyleMetrics.dark-color-scheme ? #222222 : #dddddd;
|
||||||
in-out property<color> list_view_normal_header_color: StyleMetrics.dark-color-scheme ? #111111 : #888888;
|
in-out property <color> list_view_normal_header_color: StyleMetrics.dark-color-scheme ? #111111 : #888888;
|
||||||
in-out property<color> list_view_normal_selected_header: StyleMetrics.dark-color-scheme ? #444444 : #cccccc;
|
in-out property <color> list_view_normal_selected_header: StyleMetrics.dark-color-scheme ? #444444 : #cccccc;
|
||||||
|
|
||||||
// Popup
|
// Popup
|
||||||
in-out property<color> popup_background: StyleMetrics.dark-color-scheme ? #353535 : #5e5e5e;
|
in-out property <color> popup_background: StyleMetrics.dark-color-scheme ? #353535 : #5e5e5e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,50 +7,47 @@ component TabItem {
|
||||||
in-out property <CurrentTab> active-tab;
|
in-out property <CurrentTab> active-tab;
|
||||||
in property <string> text;
|
in property <string> text;
|
||||||
in property <CurrentTab> curr_tab;
|
in property <CurrentTab> curr_tab;
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
horizontal-stretch: 1.0;
|
horizontal-stretch: 1.0;
|
||||||
background: touch-area.has-hover ? ColorPalette.tab-hovered-color : transparent;
|
background: touch-area.has-hover ? ColorPalette.tab-hovered-color : transparent;
|
||||||
|
touch_area := TouchArea {
|
||||||
touch_area:= TouchArea {
|
|
||||||
clicked => {
|
clicked => {
|
||||||
if (root.active-tab == root.curr-tab) {
|
if (root.active-tab == root.curr-tab) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
root.active-tab = root.curr-tab;
|
root.active-tab = root.curr-tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
alignment: LayoutAlignment.end;
|
alignment: LayoutAlignment.end;
|
||||||
layout_rectangle := VerticalLayout {
|
layout_rectangle := VerticalLayout {
|
||||||
empty_rectangle := Rectangle {
|
empty_rectangle := Rectangle { }
|
||||||
|
|
||||||
}
|
|
||||||
current_rectangle := Rectangle {
|
current_rectangle := Rectangle {
|
||||||
visible: (root.active-tab == root.curr-tab);
|
visible: (root.active-tab == root.curr-tab);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
width: 5px;
|
width: 5px;
|
||||||
height: 0px;
|
height: 0px;
|
||||||
background: ColorPalette.tab_selected_color;
|
background: ColorPalette.tab_selected_color;
|
||||||
animate height {
|
animate height{
|
||||||
duration: 150ms;
|
duration: 150ms;
|
||||||
easing: ease;
|
easing: ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
empty_rectangle2 := Rectangle {
|
empty_rectangle2 := Rectangle { }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: root.text;
|
text: root.text;
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
horizontal-alignment: center;
|
horizontal-alignment: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
states [
|
states [
|
||||||
is-selected when root.active-tab == root.curr-tab: {
|
is-selected when root.active-tab == root.curr-tab: {
|
||||||
current_rectangle.height: layout_rectangle.height;
|
current_rectangle.height: layout_rectangle.height;
|
||||||
|
@ -65,7 +62,6 @@ export component LeftSidePanel {
|
||||||
in-out property <CurrentTab> active-tab;
|
in-out property <CurrentTab> active-tab;
|
||||||
in-out property <bool> scanning;
|
in-out property <bool> scanning;
|
||||||
width: 120px;
|
width: 120px;
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
spacing: 20px;
|
spacing: 20px;
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -75,6 +71,7 @@ export component LeftSidePanel {
|
||||||
source: @image-url("../icons/logo.png");
|
source: @image-url("../icons/logo.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
// spacing: 3px;
|
// spacing: 3px;
|
||||||
alignment: center;
|
alignment: center;
|
||||||
|
@ -86,6 +83,7 @@ export component LeftSidePanel {
|
||||||
active-tab <=> root.active-tab;
|
active-tab <=> root.active-tab;
|
||||||
curr_tab: CurrentTab.EmptyFolders;
|
curr_tab: CurrentTab.EmptyFolders;
|
||||||
}
|
}
|
||||||
|
|
||||||
TabItem {
|
TabItem {
|
||||||
height: parent.element-size;
|
height: parent.element-size;
|
||||||
scanning: scanning;
|
scanning: scanning;
|
||||||
|
@ -93,6 +91,7 @@ export component LeftSidePanel {
|
||||||
active-tab <=> root.active-tab;
|
active-tab <=> root.active-tab;
|
||||||
curr_tab: CurrentTab.EmptyFiles;
|
curr_tab: CurrentTab.EmptyFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
TabItem {
|
TabItem {
|
||||||
height: parent.element-size;
|
height: parent.element-size;
|
||||||
scanning: scanning;
|
scanning: scanning;
|
||||||
|
@ -101,6 +100,7 @@ export component LeftSidePanel {
|
||||||
curr_tab: CurrentTab.SimilarImages;
|
curr_tab: CurrentTab.SimilarImages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
alignment: end;
|
alignment: end;
|
||||||
|
@ -110,4 +110,4 @@ export component LeftSidePanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,45 +7,46 @@ import {MainListModel} from "common.slint";
|
||||||
export component MainList {
|
export component MainList {
|
||||||
callback item_opened(string);
|
callback item_opened(string);
|
||||||
in-out property <CurrentTab> active-tab;
|
in-out property <CurrentTab> active-tab;
|
||||||
|
|
||||||
in-out property <[MainListModel]> empty_folder_model;
|
in-out property <[MainListModel]> empty_folder_model;
|
||||||
in-out property <[MainListModel]> empty_files_model;
|
in-out property <[MainListModel]> empty_files_model;
|
||||||
in-out property <[MainListModel]> similar_images_model;
|
in-out property <[MainListModel]> similar_images_model;
|
||||||
|
// TODO - using root.active-tab in visible property will not clear model
|
||||||
// TODO - using root.active-tab in visible property will not clear model
|
|
||||||
if root.active-tab == CurrentTab.EmptyFolders: SelectableTableView {
|
if root.active-tab == CurrentTab.EmptyFolders: SelectableTableView {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
|
|
||||||
columns: ["Selection", "Folder Name", "Path"];
|
columns: ["Selection", "Folder Name", "Path"];
|
||||||
last-column: "Modification Date";
|
last-column: "Modification Date";
|
||||||
column-sizes: [35px, 100px, 350px, 300px];
|
column-sizes: [35px, 100px, 350px, 300px];
|
||||||
values <=> empty-folder-model;
|
values <=> empty-folder-model;
|
||||||
parentPathIdx: 2;
|
parentPathIdx: 2;
|
||||||
fileNameIdx: 1;
|
fileNameIdx: 1;
|
||||||
item_opened(item) => {item_opened(item)}
|
item_opened(item) => {
|
||||||
|
item_opened(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if root.active-tab == CurrentTab.EmptyFiles: SelectableTableView {
|
if root.active-tab == CurrentTab.EmptyFiles: SelectableTableView {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
|
|
||||||
columns: ["Selection", "File Name", "Path"];
|
columns: ["Selection", "File Name", "Path"];
|
||||||
last-column: "Modification Date";
|
last-column: "Modification Date";
|
||||||
column-sizes: [35px, 100px, 350px, 100px];
|
column-sizes: [35px, 100px, 350px, 100px];
|
||||||
values <=> empty-files-model;
|
values <=> empty-files-model;
|
||||||
parentPathIdx: 2;
|
parentPathIdx: 2;
|
||||||
fileNameIdx: 1;
|
fileNameIdx: 1;
|
||||||
item_opened(item) => {item_opened(item)}
|
item_opened(item) => {
|
||||||
|
item_opened(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if root.active-tab == CurrentTab.SimilarImages: SelectableTableView {
|
if root.active-tab == CurrentTab.SimilarImages: SelectableTableView {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
|
|
||||||
columns: ["Selection", "File Name", "Path"];
|
columns: ["Selection", "File Name", "Path"];
|
||||||
last-column: "Modification Date";
|
last-column: "Modification Date";
|
||||||
column-sizes: [35px, 100px, 350px, 100px];
|
column-sizes: [35px, 100px, 350px, 100px];
|
||||||
values <=> similar-images-model;
|
values <=> similar-images-model;
|
||||||
parentPathIdx: 2;
|
parentPathIdx: 2;
|
||||||
fileNameIdx: 1;
|
fileNameIdx: 1;
|
||||||
item_opened(item) => {item_opened(item)}
|
item_opened(item) => {
|
||||||
|
item_opened(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,22 +19,18 @@ export component MainWindow inherits Window {
|
||||||
callback scan_starting(CurrentTab);
|
callback scan_starting(CurrentTab);
|
||||||
callback item_opened(string);
|
callback item_opened(string);
|
||||||
callback folder-choose-requested(bool);
|
callback folder-choose-requested(bool);
|
||||||
|
|
||||||
callback scan_ended(string);
|
callback scan_ended(string);
|
||||||
|
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
preferred-width: 800px;
|
preferred-width: 800px;
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
preferred-height: 600px;
|
preferred-height: 600px;
|
||||||
|
|
||||||
in-out property <bool> stop_requested: false;
|
in-out property <bool> stop_requested: false;
|
||||||
in-out property <bool> scanning: false;
|
in-out property <bool> scanning: false;
|
||||||
in-out property <ProgressToSend> progress_datas : {
|
in-out property <ProgressToSend> progress_datas: {
|
||||||
current_progress: 15,
|
current_progress: 15,
|
||||||
all_progress: 20,
|
all_progress: 20,
|
||||||
step_name: "Cache",
|
step_name: "Cache",
|
||||||
};
|
};
|
||||||
|
|
||||||
in-out property <CurrentTab> active-tab: CurrentTab.EmptyFolders;
|
in-out property <CurrentTab> active-tab: CurrentTab.EmptyFolders;
|
||||||
in-out property <[MainListModel]> empty_folder_model: [
|
in-out property <[MainListModel]> empty_folder_model: [
|
||||||
{checked: false, selected_row: false, header_row: true, val: ["kropkarz", "/Xd1", "24.10.2023"]} ,
|
{checked: false, selected_row: false, header_row: true, val: ["kropkarz", "/Xd1", "24.10.2023"]} ,
|
||||||
|
@ -44,12 +40,10 @@ export component MainWindow inherits Window {
|
||||||
];
|
];
|
||||||
in-out property <[MainListModel]> empty_files_model: [];
|
in-out property <[MainListModel]> empty_files_model: [];
|
||||||
in-out property <[MainListModel]> similar_images_model: [];
|
in-out property <[MainListModel]> similar_images_model: [];
|
||||||
|
|
||||||
VerticalBox {
|
VerticalBox {
|
||||||
HorizontalBox {
|
HorizontalBox {
|
||||||
vertical-stretch: 1.0;
|
vertical-stretch: 1.0;
|
||||||
preferred-height: 300px;
|
preferred-height: 300px;
|
||||||
|
|
||||||
LeftSidePanel {
|
LeftSidePanel {
|
||||||
horizontal-stretch: 0.0;
|
horizontal-stretch: 0.0;
|
||||||
scanning <=> root.scanning;
|
scanning <=> root.scanning;
|
||||||
|
@ -65,20 +59,26 @@ export component MainWindow inherits Window {
|
||||||
empty_files_model <=> root.empty_files_model;
|
empty_files_model <=> root.empty_files_model;
|
||||||
similar_images_model <=> root.similar_images_model;
|
similar_images_model <=> root.similar_images_model;
|
||||||
|
|
||||||
item_opened(item) => {item_opened(item)}
|
item_opened(item) => {
|
||||||
|
item_opened(item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if root.scanning: Progress {
|
|
||||||
|
if root.scanning: Progress {
|
||||||
horizontal-stretch: 0.0;
|
horizontal-stretch: 0.0;
|
||||||
progress_datas <=> root.progress_datas;
|
progress_datas <=> root.progress_datas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
action_buttons := ActionButtons {
|
action_buttons := ActionButtons {
|
||||||
vertical-stretch: 0.0;
|
vertical-stretch: 0.0;
|
||||||
scanning <=> root.scanning;
|
scanning <=> root.scanning;
|
||||||
active-tab <=> root.active-tab;
|
active-tab <=> root.active-tab;
|
||||||
stop_requested <=> root.stop-requested;
|
stop_requested <=> root.stop-requested;
|
||||||
deleted => {root.deleted();}
|
deleted => {
|
||||||
|
root.deleted();
|
||||||
|
}
|
||||||
scan_stopping => {
|
scan_stopping => {
|
||||||
text_summary.text = "Stopping scan, please wait...";
|
text_summary.text = "Stopping scan, please wait...";
|
||||||
root.scan_stopping();
|
root.scan_stopping();
|
||||||
|
@ -88,15 +88,20 @@ export component MainWindow inherits Window {
|
||||||
root.scan_starting(item);
|
root.scan_starting(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
text_summary := LineEdit {
|
text_summary := LineEdit {
|
||||||
read-only: true;
|
read-only: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bottom_panel := BottomPanel {
|
bottom_panel := BottomPanel {
|
||||||
property <bool> included-directories; // TODO why cannot set popup_item property? Strange limitation
|
property <bool> included-directories;
|
||||||
|
// TODO why cannot set popup_item property? Strange limitation
|
||||||
|
|
||||||
bottom-panel-visibility <=> action_buttons.bottom-panel-visibility;
|
bottom-panel-visibility <=> action_buttons.bottom-panel-visibility;
|
||||||
vertical-stretch: 0.0;
|
vertical-stretch: 0.0;
|
||||||
folder-choose-requested(included-directories) => {root.folder-choose-requested(included-directories)}
|
folder-choose-requested(included-directories) => {
|
||||||
|
root.folder-choose-requested(included-directories)
|
||||||
|
}
|
||||||
show_manual_add_dialog(included-directories) => {
|
show_manual_add_dialog(included-directories) => {
|
||||||
self.included-directories = included-directories;
|
self.included-directories = included-directories;
|
||||||
popup-item.show()
|
popup-item.show()
|
||||||
|
@ -107,12 +112,9 @@ export component MainWindow inherits Window {
|
||||||
popup_item := PopupWindow {
|
popup_item := PopupWindow {
|
||||||
height: root.height;
|
height: root.height;
|
||||||
width: root.width;
|
width: root.width;
|
||||||
|
|
||||||
property <bool> included_directories;
|
property <bool> included_directories;
|
||||||
private property <string> text_data;
|
private property <string> text_data;
|
||||||
|
|
||||||
close-on-click: false;
|
close-on-click: false;
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
alignment: LayoutAlignment.center;
|
alignment: LayoutAlignment.center;
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
|
@ -128,10 +130,12 @@ export component MainWindow inherits Window {
|
||||||
text: "Please add directories one per line";
|
text: "Please add directories one per line";
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
horizontal-alignment: TextHorizontalAlignment.center;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEdit {
|
TextEdit {
|
||||||
vertical-stretch: 1.0;
|
vertical-stretch: 1.0;
|
||||||
text <=> text-data;
|
text <=> text-data;
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
Button {
|
Button {
|
||||||
|
@ -142,6 +146,7 @@ export component MainWindow inherits Window {
|
||||||
popup-item.close();
|
popup-item.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Cancel";
|
text: "Cancel";
|
||||||
clicked => {
|
clicked => {
|
||||||
|
@ -153,7 +158,6 @@ export component MainWindow inherits Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scan_ended(scan_text) => {
|
scan_ended(scan_text) => {
|
||||||
|
|
|
@ -9,12 +9,12 @@ export component Progress {
|
||||||
in-out property <ProgressToSend> progress_datas;
|
in-out property <ProgressToSend> progress_datas;
|
||||||
preferred-width: 400px;
|
preferred-width: 400px;
|
||||||
preferred-height: 40px;
|
preferred-height: 40px;
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
Text {
|
Text {
|
||||||
text: progress-datas.step-name;
|
text: progress-datas.step-name;
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
horizontal-alignment: TextHorizontalAlignment.center;
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
|
@ -23,11 +23,13 @@ export component Progress {
|
||||||
vertical-alignment: TextVerticalAlignment.center;
|
vertical-alignment: TextVerticalAlignment.center;
|
||||||
text: "Current Stage:";
|
text: "Current Stage:";
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
vertical-alignment: TextVerticalAlignment.center;
|
vertical-alignment: TextVerticalAlignment.center;
|
||||||
text: "All Stages:";
|
text: "All Stages:";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
|
@ -38,25 +40,28 @@ export component Progress {
|
||||||
progress: progress_datas.current-progress / 100.0;
|
progress: progress_datas.current-progress / 100.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: LayoutAlignment.center;
|
alignment: LayoutAlignment.center;
|
||||||
ProgressIndicator {
|
ProgressIndicator {
|
||||||
height: 8px;
|
height: 8px;
|
||||||
progress: progress_datas.all-progress / 100.0;
|
progress: progress_datas.all-progress / 100.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
Text {
|
Text {
|
||||||
vertical-alignment: TextVerticalAlignment.center;
|
vertical-alignment: TextVerticalAlignment.center;
|
||||||
text: progress_datas.current-progress + "%";
|
text: progress_datas.current-progress + "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
vertical-alignment: TextVerticalAlignment.center;
|
vertical-alignment: TextVerticalAlignment.center;
|
||||||
text: progress_datas.all-progress + "%";
|
text: progress_datas.all-progress + "%";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,23 +6,17 @@ import {MainListModel} from "common.slint";
|
||||||
|
|
||||||
export component SelectableTableView inherits Rectangle {
|
export component SelectableTableView inherits Rectangle {
|
||||||
callback item_opened(string);
|
callback item_opened(string);
|
||||||
|
|
||||||
in property <[string]> columns;
|
in property <[string]> columns;
|
||||||
in property <string> last_column;
|
in property <string> last_column;
|
||||||
in-out property <[MainListModel]> values;
|
in-out property <[MainListModel]> values;
|
||||||
|
|
||||||
in-out property <[length]> column_sizes;
|
in-out property <[length]> column_sizes;
|
||||||
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 <[length]> real_sizes: [0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px, 0px];
|
||||||
private property <int> column_number: column-sizes.length + 1;
|
private property <int> column_number: column-sizes.length + 1;
|
||||||
|
|
||||||
// This idx, starts from zero, but since first is always a checkbox, and is not in model.val values, remove 1 from idx
|
// This idx, starts from zero, but since first is always a checkbox, and is not in model.val values, remove 1 from idx
|
||||||
in-out property <int> parentPathIdx;
|
in-out property <int> parentPathIdx;
|
||||||
in-out property <int> fileNameIdx;
|
in-out property <int> fileNameIdx;
|
||||||
|
|
||||||
in-out property <int> selected_item: -1;
|
in-out property <int> selected_item: -1;
|
||||||
|
|
||||||
forward-focus: focus_item;
|
forward-focus: focus_item;
|
||||||
|
|
||||||
// TODO not works
|
// TODO not works
|
||||||
focus_item := FocusScope {
|
focus_item := FocusScope {
|
||||||
key-released(event) => {
|
key-released(event) => {
|
||||||
|
@ -35,18 +29,20 @@ export component SelectableTableView inherits Rectangle {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
forward-focus: focus-item;
|
forward-focus: focus-item;
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
vertical-stretch: 0;
|
vertical-stretch: 0;
|
||||||
for title[idx] in root.columns : HorizontalLayout {
|
for title [idx] in root.columns: HorizontalLayout {
|
||||||
width: root.column-sizes[idx];
|
width: root.column-sizes[idx];
|
||||||
|
Text {
|
||||||
|
overflow: elide;
|
||||||
|
text: title;
|
||||||
|
}
|
||||||
|
|
||||||
Text { overflow: elide; text: title; }
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
background: gray;
|
background: gray;
|
||||||
forward-focus: focus-item;
|
forward-focus: focus-item;
|
||||||
|
|
||||||
TouchArea {
|
TouchArea {
|
||||||
width: 5px;
|
width: 5px;
|
||||||
x: (parent.width - self.width) / 2;
|
x: (parent.width - self.width) / 2;
|
||||||
|
@ -69,18 +65,22 @@ export component SelectableTableView inherits Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text { overflow: elide; text: last-column; }
|
|
||||||
|
Text {
|
||||||
|
overflow: elide;
|
||||||
|
text: last-column;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list_view := ListView {
|
list_view := ListView {
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
forward-focus: focus-item;
|
forward-focus: focus-item;
|
||||||
|
for r [idx] in root.values: Rectangle {
|
||||||
for r[idx] in root.values : Rectangle {
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
forward-focus: focus-item;
|
forward-focus: focus-item;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
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));
|
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 {
|
touch_area := TouchArea {
|
||||||
forward-focus: focus-item;
|
forward-focus: focus-item;
|
||||||
clicked => {
|
clicked => {
|
||||||
if (!r.header_row) {
|
if (!r.header_row) {
|
||||||
|
@ -109,7 +109,6 @@ export component SelectableTableView inherits Rectangle {
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
forward-focus: focus-item;
|
forward-focus: focus-item;
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
visible: !r.header-row;
|
visible: !r.header-row;
|
||||||
checked: r.checked && !r.header-row;
|
checked: r.checked && !r.header-row;
|
||||||
|
@ -122,14 +121,12 @@ export component SelectableTableView inherits Rectangle {
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
for f[idx] in r.val : Text {
|
for f [idx] in r.val: Text {
|
||||||
width: root.column-sizes[idx + 1];
|
width: root.column-sizes[idx + 1];
|
||||||
text: f;
|
text: f;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
forward-focus: focus-item;
|
forward-focus: focus-item;
|
||||||
|
|
||||||
vertical-alignment: center;
|
vertical-alignment: center;
|
||||||
|
|
||||||
overflow: elide;
|
overflow: elide;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,4 +134,4 @@ export component SelectableTableView inherits Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
export global Settings {
|
export global Settings {
|
||||||
in-out property <[StandardListViewItem]> included_directories: [{text: "ABCD"}, {text: "BCDA"}];
|
in-out property <[StandardListViewItem]> included_directories: [{text: "ABCD"}, {text: "BCDA"}];
|
||||||
in-out property <[StandardListViewItem]> excluded_directories: [{text: "ABCD"}, {text: "BCDA"}, {text: "CDFFF"}];
|
in-out property <[StandardListViewItem]> excluded_directories: [{text: "ABCD"}, {text: "BCDA"}, {text: "CDFFF"}];
|
||||||
|
|
||||||
in-out property <string> info_text: "Nothing to report";
|
in-out property <string> info_text: "Nothing to report";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue