Add UI for project approach
This commit is contained in:
parent
b35967d6dc
commit
88c8923989
|
@ -1,11 +1,11 @@
|
|||
import { Button, TabWidget, LineEdit, GroupBox } from "std-widgets.slint";
|
||||
|
||||
enum State {
|
||||
ConvertImage,
|
||||
Test
|
||||
OpenProject,
|
||||
SaveProject
|
||||
}
|
||||
|
||||
component ConvertImageWidget inherits Rectangle {
|
||||
component OpenProjectWidget inherits Rectangle {
|
||||
in-out property <string> path;
|
||||
|
||||
callback browse_clicked();
|
||||
|
@ -15,14 +15,14 @@ component ConvertImageWidget inherits Rectangle {
|
|||
height: 100%;
|
||||
|
||||
GroupBox {
|
||||
title: "Convert image to TIM";
|
||||
title: "Open project";
|
||||
x: 4px;
|
||||
y: 4px;
|
||||
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
Text {
|
||||
text: "Select image file to convert to TIM";
|
||||
text: "Select project file to open with TIM Tool";
|
||||
}
|
||||
LineEdit {
|
||||
width: 200%;
|
||||
|
@ -43,7 +43,7 @@ component ConvertImageWidget inherits Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
component TestWidget inherits Rectangle {
|
||||
component SaveProjectWidget inherits Rectangle {
|
||||
Text {
|
||||
text: "!!Planschbecken!!";
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ export component FileTab inherits Rectangle {
|
|||
in-out property <string> conv_image_path;
|
||||
callback conv_image_browse_clicked;
|
||||
|
||||
property <State> state: ConvertImage;
|
||||
property <State> state;
|
||||
x: 0px;
|
||||
y: 0px;
|
||||
|
||||
|
@ -65,15 +65,15 @@ export component FileTab inherits Rectangle {
|
|||
alignment: start;
|
||||
|
||||
Button {
|
||||
text: "Convert image file";
|
||||
text: "Open project";
|
||||
clicked => {
|
||||
root.state = State.ConvertImage;
|
||||
root.state = State.OpenProject;
|
||||
}
|
||||
}
|
||||
Button {
|
||||
text: "Testing";
|
||||
text: "Save project";
|
||||
clicked => {
|
||||
root.state = State.Test;
|
||||
root.state = State.SaveProject;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,13 +81,13 @@ export component FileTab inherits Rectangle {
|
|||
VerticalLayout {
|
||||
padding: 4px;
|
||||
alignment: start;
|
||||
if root.state == State.ConvertImage : ConvertImageWidget {
|
||||
if root.state == State.OpenProject : OpenProjectWidget {
|
||||
path <=> root.conv_image_path;
|
||||
browse_clicked => {
|
||||
root.conv_image_browse_clicked();
|
||||
}
|
||||
}
|
||||
if root.state == State.Test : TestWidget {
|
||||
if root.state == State.SaveProject : SaveProjectWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ export component MainTab inherits Rectangle {
|
|||
HorizontalLayout {
|
||||
padding: 4px;
|
||||
GroupBox {
|
||||
title: "Added TIMs";
|
||||
title: "Added files";
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
padding: 4px;
|
||||
|
@ -103,11 +103,11 @@ export component MainTab inherits Rectangle {
|
|||
HorizontalLayout {
|
||||
padding: 4px;
|
||||
Button {
|
||||
text: "Add TIM";
|
||||
text: "Add file";
|
||||
clicked => {root.add_file_clicked();}
|
||||
}
|
||||
Button {
|
||||
text: "Remove TIM";
|
||||
text: "Remove file";
|
||||
clicked => {
|
||||
root.remove_file_clicked(vram_files_list.current_item);
|
||||
vram_files_list.current-item = -1;
|
||||
|
|
Loading…
Reference in New Issue