1
0
Fork 0
mirror of synced 2024-07-01 20:41:16 +12:00
czkawka/czkawka_slint_gui/ui/left_side_panel.slint

89 lines
2.5 KiB
Plaintext
Raw Normal View History

2023-10-21 21:01:22 +13:00
import { Button, VerticalBox , HorizontalBox, TabWidget, ListView, StandardListView, StandardTableView, CheckBox} from "std-widgets.slint";
import {CurrentTab} from "common.slint";
2023-10-28 08:37:51 +13:00
import {ColorPalette} from "color_palette.slint";
2023-10-21 21:01:22 +13:00
component TabItem {
in property <bool> scanning;
in-out property <CurrentTab> active-tab;
in property <string> text;
in property <CurrentTab> curr_tab;
2023-10-28 08:37:51 +13:00
Rectangle {
width: parent.width;
horizontal-stretch: 1.0;
2023-10-29 05:20:46 +13:00
background: touch-area.has-hover ? ColorPalette.tab-hovered-color : transparent;
2023-10-28 08:37:51 +13:00
opacity: 0.05;
touch_area:= TouchArea {
clicked => {
root.active-tab = root.curr-tab;
}
}
}
HorizontalLayout {
width: parent.width;
alignment: LayoutAlignment.end;
Rectangle {
visible: (root.active-tab == root.curr-tab);
width: 5px;
background: ColorPalette.tab_selected_color;
}
}
Text {
2023-10-21 21:01:22 +13:00
text: root.text;
2023-10-28 08:37:51 +13:00
width: parent.width;
horizontal-alignment: center;
2023-10-21 21:01:22 +13:00
}
}
export component LeftSidePanel {
in-out property <CurrentTab> active-tab;
in-out property <bool> scanning;
2023-10-22 22:32:13 +13:00
width: 120px;
2023-10-21 21:01:22 +13:00
VerticalLayout {
2023-10-22 22:32:13 +13:00
spacing: 20px;
Rectangle {
height: 100px;
Image {
width: root.width;
source: @image-url("../icons/logo.png");
}
2023-10-21 21:01:22 +13:00
}
2023-10-22 22:32:13 +13:00
VerticalLayout {
2023-10-28 08:37:51 +13:00
// spacing: 3px;
2023-10-22 22:32:13 +13:00
alignment: center;
2023-10-28 08:37:51 +13:00
out property <length> element-size: 25px;
2023-10-22 22:32:13 +13:00
TabItem {
2023-10-28 08:37:51 +13:00
height: parent.element-size;
2023-10-22 22:32:13 +13:00
scanning: scanning;
text: "Empty Folders";
active-tab <=> root.active-tab;
curr_tab: CurrentTab.EmptyFolders;
}
TabItem {
2023-10-28 08:37:51 +13:00
height: parent.element-size;
2023-10-22 22:32:13 +13:00
scanning: scanning;
text: "Empty Files";
active-tab <=> root.active-tab;
curr_tab: CurrentTab.EmptyFiles;
}
TabItem {
2023-10-28 08:37:51 +13:00
height: parent.element-size;
2023-10-22 22:32:13 +13:00
scanning: scanning;
text: "Similar Images";
active-tab <=> root.active-tab;
curr_tab: CurrentTab.SimilarImages;
}
2023-10-21 21:01:22 +13:00
}
2023-10-22 22:32:13 +13:00
HorizontalLayout {
height: 20px;
alignment: end;
Image {
width: 20px;
source: @image-url("../icons/settings.png");
}
2023-10-21 21:01:22 +13:00
}
}
}