2023-12-03 11:06:42 +00:00
|
|
|
|
|
|
|
import {Button, StandardListView, VerticalBox, ScrollView, TextEdit} from "std-widgets.slint";
|
|
|
|
import {Settings} from "settings.slint";
|
|
|
|
import {BottomPanelVisibility} from "common.slint";
|
|
|
|
import {Callabler} from "callabler.slint";
|
|
|
|
import {GuiState} from "gui_state.slint";
|
2024-02-14 16:45:25 +00:00
|
|
|
import {IncludedDirectories, ExcludedDirectories} from "included_directories.slint";
|
2023-12-03 11:06:42 +00:00
|
|
|
|
|
|
|
component DirectoriesPanel inherits HorizontalLayout {
|
|
|
|
callback folder_choose_requested(bool);
|
|
|
|
callback show_manual_add_dialog(bool);
|
2024-02-14 16:45:25 +00:00
|
|
|
|
|
|
|
spacing: 5px;
|
2023-12-03 11:06:42 +00:00
|
|
|
// Included directories
|
|
|
|
VerticalLayout {
|
|
|
|
horizontal-stretch: 0.0;
|
|
|
|
spacing: 5px;
|
|
|
|
Button {
|
|
|
|
text: "Add";
|
|
|
|
clicked => {
|
|
|
|
folder_choose_requested(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Remove";
|
|
|
|
clicked => {
|
2024-02-14 16:45:25 +00:00
|
|
|
Callabler.remove_item_directories(true);
|
2023-12-03 11:06:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Manual Add";
|
|
|
|
clicked => {
|
|
|
|
show_manual_add_dialog(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
vertical-stretch: 1.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VerticalLayout {
|
|
|
|
horizontal-stretch: 1.0;
|
|
|
|
Rectangle {
|
|
|
|
Text {
|
|
|
|
text: "Included Directories";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-14 16:45:25 +00:00
|
|
|
included_list := IncludedDirectories { }
|
2023-12-03 11:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Excluded directories
|
|
|
|
VerticalLayout {
|
|
|
|
horizontal-stretch: 0.0;
|
|
|
|
spacing: 5px;
|
|
|
|
Button {
|
|
|
|
text: "Add";
|
|
|
|
clicked => {
|
|
|
|
folder_choose_requested(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Remove";
|
|
|
|
clicked => {
|
2024-02-14 16:45:25 +00:00
|
|
|
Callabler.remove_item_directories(false);
|
2023-12-03 11:06:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Manual Add";
|
|
|
|
clicked => {
|
|
|
|
show_manual_add_dialog(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
vertical-stretch: 1.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VerticalLayout {
|
|
|
|
horizontal-stretch: 1.0;
|
|
|
|
Rectangle {
|
|
|
|
Text {
|
|
|
|
text: "Excluded Directories";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-14 16:45:25 +00:00
|
|
|
excluded_list := ExcludedDirectories { }
|
2023-12-03 11:06:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
component TextErrorsPanel inherits TextEdit {
|
|
|
|
height: 20px;
|
|
|
|
read-only: true;
|
|
|
|
wrap: TextWrap.no-wrap;
|
|
|
|
text <=> GuiState.info_text;
|
|
|
|
}
|
|
|
|
|
|
|
|
export component BottomPanel {
|
|
|
|
in-out property <BottomPanelVisibility> bottom_panel_visibility: BottomPanelVisibility.Directories;
|
|
|
|
callback folder_choose_requested(bool);
|
|
|
|
callback show_manual_add_dialog(bool);
|
|
|
|
min-height: bottom-panel-visibility == BottomPanelVisibility.NotVisible ? 0px : 150px;
|
|
|
|
min-width: bottom-panel-visibility == BottomPanelVisibility.NotVisible ? 0px : 400px;
|
|
|
|
if bottom-panel-visibility == BottomPanelVisibility.Directories: DirectoriesPanel {
|
|
|
|
width: parent.width;
|
|
|
|
height: parent.height;
|
|
|
|
folder_choose_requested(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 {
|
|
|
|
width: parent.width;
|
|
|
|
height: parent.height;
|
|
|
|
}
|
|
|
|
}
|