Retrieve file conversion path

This commit is contained in:
2025-02-10 22:16:25 +01:00
parent 7f831bc09b
commit 3054fab315
4 changed files with 145 additions and 26 deletions

View File

@@ -1,3 +1,94 @@
export component FileTab inherits Rectangle {
import { Button, TabWidget, LineEdit, GroupBox } from "std-widgets.slint";
enum State {
ConvertImage,
Test
}
component ConvertImageWidget inherits Rectangle {
in-out property <string> path;
callback browse_clicked();
background: #D0D0D0;
width: 100%;
height: 100%;
GroupBox {
title: "Convert image to TIM";
x: 4px;
y: 4px;
VerticalLayout {
alignment: start;
Text {
text: "Select image file to convert to TIM";
}
LineEdit {
width: 200%;
text: path;
}
HorizontalLayout {
alignment: start;
padding: 4px;
Button {
text: "Browse";
clicked => {browse_clicked();}
}
Button {
text: "Convert";
}
}
}
}
}
component TestWidget inherits Rectangle {
Text {
text: "!!Planschbecken!!";
}
}
export component FileTab inherits Rectangle {
in-out property <string> conv_image_path;
callback conv_image_browse_clicked;
property <State> state: ConvertImage;
x: 0px;
y: 0px;
HorizontalLayout {
padding: 4px;
VerticalLayout {
padding: 4px;
width: 20%;
alignment: start;
Button {
text: "Convert image file";
clicked => {
root.state = State.ConvertImage;
}
}
Button {
text: "Testing";
clicked => {
root.state = State.Test;
}
}
}
VerticalLayout {
padding: 4px;
alignment: start;
if root.state == State.ConvertImage : ConvertImageWidget {
path <=> root.conv_image_path;
browse_clicked => {
root.conv_image_browse_clicked();
}
}
if root.state == State.Test : TestWidget {
}
}
}
}

View File

@@ -91,7 +91,7 @@ export component MainTab inherits Rectangle {
HorizontalLayout {
padding: 4px;
GroupBox {
title: "Added Files";
title: "Added TIMs";
VerticalLayout {
alignment: start;
padding: 4px;
@@ -103,11 +103,11 @@ export component MainTab inherits Rectangle {
HorizontalLayout {
padding: 4px;
Button {
text: "Add File";
text: "Add TIM";
clicked => {root.add_file_clicked();}
}
Button {
text: "Remove File";
text: "Remove TIM";
clicked => {
root.remove_file_clicked(vram_files_list.current_item);
vram_files_list.current-item = -1;