1
0
Fork 0
mirror of synced 2024-06-15 00:45:29 +12:00
czkawka/czkawka_slint_gui/ui/bottom_panel.slint
Rafał Mikrut adb905f9b7 Async
2023-11-01 21:52:25 +01:00

87 lines
2.4 KiB
Plaintext

import {Button, StandardListView, VerticalBox} from "std-widgets.slint";
import {Settings} from "settings.slint";
import {BottomPanelVisibility} from "common.slint";
component DirectoriesPanel {
out property <length> buttonSize: 75px;
callback folder-choose-requested(bool);
HorizontalLayout {
VerticalLayout {
width: buttonSize;
Button {
text: "Add";
clicked => {
folder-choose-requested(true);
}
}
Button {
text: "Remove";
}
Rectangle {
vertical-stretch: 1.0;
}
}
VerticalLayout {
Rectangle {
Text {
text: "Included Directories";
}
}
StandardListView {
model: Settings.included-directories;
}
}
VerticalLayout {
width: buttonSize;
Button {
text: "Add";
clicked => {
folder-choose-requested(false);
}
}
Button {
text: "Remove";
}
Rectangle {
vertical-stretch: 1.0;
}
}
VerticalLayout {
Rectangle {
Text {
text: "Excluded Directories";
}
}
StandardListView {
model: Settings.excluded-directories;
}
}
}
}
// TODO this should be a normal read only Text editor
component TextErrorsPanel {
Rectangle {
background: red;
}
}
export component BottomPanel {
in-out property <BottomPanelVisibility> bottom_panel_visibility: BottomPanelVisibility.Directories;
callback folder-choose-requested(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)}
}
if bottom-panel-visibility == BottomPanelVisibility.TextErrors : TextErrorsPanel {
width: parent.width;
height: parent.height;
}
}