2023-10-22 22:32:13 +13:00
|
|
|
import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListView, StandardTableView, CheckBox} from "std-widgets.slint";
|
|
|
|
import {LeftSidePanel} from "left_side_panel.slint";
|
|
|
|
import {MainList} from "main_lists.slint";
|
|
|
|
import {CurrentTab} from "common.slint";
|
2023-11-02 05:47:45 +13:00
|
|
|
import {BottomPanelVisibility} from "common.slint";
|
2023-10-22 22:32:13 +13:00
|
|
|
|
2023-11-02 05:47:45 +13:00
|
|
|
export component VisibilityButton inherits Button {
|
|
|
|
in-out property <BottomPanelVisibility> button_visibility;
|
|
|
|
in-out property <BottomPanelVisibility> bottom_panel_visibility;
|
|
|
|
enabled: bottom_panel_visibility != button-visibility;
|
|
|
|
height: 30px;
|
|
|
|
width: 70px;
|
|
|
|
clicked => {
|
|
|
|
bottom-panel-visibility = button_visibility;
|
|
|
|
}
|
|
|
|
}
|
2023-10-22 22:32:13 +13:00
|
|
|
|
2023-11-02 09:52:25 +13:00
|
|
|
export component ActionButtons inherits HorizontalLayout {
|
2023-10-22 22:32:13 +13:00
|
|
|
callback deleted;
|
2023-10-27 07:57:17 +13:00
|
|
|
callback scan_stopping;
|
|
|
|
callback scan_starting(CurrentTab);
|
2023-11-02 05:47:45 +13:00
|
|
|
in-out property <BottomPanelVisibility> bottom_panel_visibility: BottomPanelVisibility.Directories;
|
2023-10-27 07:57:17 +13:00
|
|
|
in-out property <bool> stop_requested: false;
|
2023-10-22 22:32:13 +13:00
|
|
|
in-out property <bool> scanning;
|
|
|
|
in-out property <CurrentTab> active-tab;
|
2023-11-02 09:52:25 +13:00
|
|
|
out property <int> name;
|
|
|
|
height: 30px;
|
|
|
|
spacing: 4px;
|
2023-11-11 05:11:32 +13:00
|
|
|
scan_button := Button {
|
2023-11-02 09:52:25 +13:00
|
|
|
height: parent.height;
|
|
|
|
enabled: !scanning;
|
|
|
|
text: "Scan";
|
|
|
|
clicked => {
|
|
|
|
root.scanning = true;
|
|
|
|
root.scan_starting(active-tab);
|
2023-10-27 07:57:17 +13:00
|
|
|
}
|
2023-11-02 09:52:25 +13:00
|
|
|
}
|
2023-11-11 05:11:32 +13:00
|
|
|
|
|
|
|
stop_button := Button {
|
2023-11-02 09:52:25 +13:00
|
|
|
height: parent.height;
|
|
|
|
enabled: scanning && !stop_requested;
|
|
|
|
text: "Stop";
|
|
|
|
clicked => {
|
|
|
|
root.scan_stopping();
|
|
|
|
root.stop_requested = true;
|
2023-10-22 22:32:13 +13:00
|
|
|
}
|
2023-11-02 09:52:25 +13:00
|
|
|
}
|
2023-11-03 06:29:38 +13:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
horizontal-stretch: 0.5;
|
|
|
|
}
|
|
|
|
|
2023-11-11 05:11:32 +13:00
|
|
|
delete_button := Button {
|
2023-11-02 09:52:25 +13:00
|
|
|
height: parent.height;
|
|
|
|
enabled: !scanning;
|
|
|
|
text: "Delete";
|
|
|
|
clicked => {
|
|
|
|
root.deleted();
|
2023-10-22 22:32:13 +13:00
|
|
|
}
|
2023-11-02 09:52:25 +13:00
|
|
|
}
|
2023-11-11 05:11:32 +13:00
|
|
|
|
2023-11-03 06:29:38 +13:00
|
|
|
Rectangle {
|
|
|
|
horizontal-stretch: 0.5;
|
2023-11-02 09:52:25 +13:00
|
|
|
}
|
2023-11-03 06:29:38 +13:00
|
|
|
|
|
|
|
HorizontalLayout {
|
|
|
|
padding: 0px;
|
|
|
|
spacing: 0px;
|
|
|
|
VisibilityButton {
|
|
|
|
height: parent.height;
|
|
|
|
button-visibility: BottomPanelVisibility.Directories;
|
|
|
|
bottom_panel_visibility <=> bottom_panel_visibility;
|
|
|
|
text: "Dirs";
|
|
|
|
}
|
|
|
|
|
|
|
|
VisibilityButton {
|
|
|
|
height: parent.height;
|
|
|
|
button-visibility: BottomPanelVisibility.TextErrors;
|
|
|
|
bottom_panel_visibility <=> bottom_panel_visibility;
|
|
|
|
text: "Text";
|
|
|
|
}
|
|
|
|
|
|
|
|
VisibilityButton {
|
|
|
|
height: parent.height;
|
|
|
|
button-visibility: BottomPanelVisibility.NotVisible;
|
|
|
|
bottom_panel_visibility <=> bottom_panel_visibility;
|
2023-11-11 04:49:54 +13:00
|
|
|
text: "None";
|
2023-11-03 06:29:38 +13:00
|
|
|
}
|
2023-10-22 22:32:13 +13:00
|
|
|
}
|
2023-11-11 05:11:32 +13:00
|
|
|
}
|