2
0
mirror of https://github.com/qarmin/czkawka synced 2024-11-12 01:10:45 +00:00
czkawka/krokiet/ui/bottom_panel.slint
Rafał Mikrut 743f98155c Included
2024-01-23 18:28:06 +01:00

126 lines
3.3 KiB
Plaintext

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";
import {IncludedDirectories, ExcludedDirectories} from "included_directories.slint";
component DirectoriesPanel inherits HorizontalLayout {
callback folder_choose_requested(bool);
callback show_manual_add_dialog(bool);
spacing: 5px;
// Included directories
VerticalLayout {
horizontal-stretch: 0.0;
spacing: 5px;
Button {
text: "Add";
clicked => {
folder_choose_requested(true);
}
}
Button {
text: "Remove";
clicked => {
Callabler.remove_item_directories(true, included_list.current_index);
}
}
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";
}
}
included_list := IncludedDirectories { }
}
// Excluded directories
VerticalLayout {
horizontal-stretch: 0.0;
spacing: 5px;
Button {
text: "Add";
clicked => {
folder_choose_requested(false);
}
}
Button {
text: "Remove";
clicked => {
Callabler.remove_item_directories(false, excluded_list.current_index);
}
}
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";
}
}
excluded_list := ExcludedDirectories { }
}
}
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;
}
}