Redirect to file dialog
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
import { Button, TabWidget, LineEdit, GroupBox } from "std-widgets.slint";
|
||||
|
||||
enum State {
|
||||
OpenProject,
|
||||
SaveProject
|
||||
export enum State {
|
||||
Project,
|
||||
ConvertImage,
|
||||
}
|
||||
|
||||
component OpenProjectWidget inherits Rectangle {
|
||||
component ProjectWidget inherits Rectangle {
|
||||
Text {
|
||||
text: "!!Planschbecken!!";
|
||||
}
|
||||
}
|
||||
|
||||
component ConvertImageWidget inherits Rectangle {
|
||||
in-out property <string> path;
|
||||
|
||||
callback browse_clicked();
|
||||
@@ -43,17 +49,11 @@ component OpenProjectWidget inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
component SaveProjectWidget inherits Rectangle {
|
||||
Text {
|
||||
text: "!!Planschbecken!!";
|
||||
}
|
||||
}
|
||||
|
||||
export component FileTab inherits Rectangle {
|
||||
in-out property <string> conv_image_path;
|
||||
in-out property <State> state;
|
||||
callback conv_image_browse_clicked;
|
||||
|
||||
property <State> state;
|
||||
x: 0px;
|
||||
y: 0px;
|
||||
|
||||
@@ -65,15 +65,15 @@ export component FileTab inherits Rectangle {
|
||||
alignment: start;
|
||||
|
||||
Button {
|
||||
text: "Open project";
|
||||
text: "Projects";
|
||||
clicked => {
|
||||
root.state = State.OpenProject;
|
||||
root.state = State.Project;
|
||||
}
|
||||
}
|
||||
Button {
|
||||
text: "Save project";
|
||||
text: "Add Image";
|
||||
clicked => {
|
||||
root.state = State.SaveProject;
|
||||
root.state = State.ConvertImage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,14 +81,15 @@ export component FileTab inherits Rectangle {
|
||||
VerticalLayout {
|
||||
padding: 4px;
|
||||
alignment: start;
|
||||
if root.state == State.OpenProject : OpenProjectWidget {
|
||||
if root.state == State.Project : ProjectWidget {
|
||||
}
|
||||
if root.state == State.ConvertImage : ConvertImageWidget {
|
||||
path <=> root.conv_image_path;
|
||||
browse_clicked => {
|
||||
root.conv_image_browse_clicked();
|
||||
}
|
||||
}
|
||||
if root.state == State.SaveProject : SaveProjectWidget {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user