Update UI again
This commit is contained in:
parent
c237a9af45
commit
d72d8bd84a
|
@ -14,6 +14,7 @@ export component MainWindow inherits Window {
|
|||
|
||||
// Convert Image values
|
||||
in-out property file_tab_browse_path <=> file_tab.conv_image_path;
|
||||
in-out property file_tab_image_data <=> file_tab.conv_image_data;
|
||||
callback file_tab_browse_convert_image <=> file_tab.conv_image_browse_clicked;
|
||||
|
||||
title: "TIM Tool 0.1.0";
|
||||
|
|
|
@ -12,45 +12,82 @@ component ProjectWidget inherits Rectangle {
|
|||
}
|
||||
|
||||
component ConvertImageWidget inherits Rectangle {
|
||||
in-out property <string> path;
|
||||
in-out property <string> image_path;
|
||||
in-out property <image> image_data;
|
||||
|
||||
callback browse_clicked();
|
||||
|
||||
background: #D0D0D0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
GroupBox {
|
||||
title: "Open project";
|
||||
x: 4px;
|
||||
y: 4px;
|
||||
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
Text {
|
||||
text: "Select project file to open with TIM Tool";
|
||||
}
|
||||
LineEdit {
|
||||
width: 200%;
|
||||
text: path;
|
||||
}
|
||||
HorizontalLayout {
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
GroupBox {
|
||||
title: "Add image file";
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
padding: 4px;
|
||||
Button {
|
||||
text: "Browse";
|
||||
clicked => {browse_clicked();}
|
||||
padding: 4px;
|
||||
Text {
|
||||
text: "Select image file to convert to be used with TIM Tool";
|
||||
}
|
||||
Button {
|
||||
text: "Convert";
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
padding: 4px;
|
||||
LineEdit {
|
||||
width: 300pt;
|
||||
text: image_path;
|
||||
}
|
||||
Button {
|
||||
text: "Browse";
|
||||
clicked => {browse_clicked();}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
title: "Loaded image";
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
padding: 4px;
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Rectangle {
|
||||
width: 256px;
|
||||
height: 256px;
|
||||
background: #000000;
|
||||
Image {
|
||||
width: 256px;
|
||||
height: 256px;
|
||||
source: root.image_data;
|
||||
image-fit: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Text {
|
||||
text: "Name: ";
|
||||
}
|
||||
}
|
||||
LineEdit {}
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
Button {
|
||||
text: "Add Image";
|
||||
enabled: false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export component FileTab inherits Rectangle {
|
||||
in-out property <string> conv_image_path;
|
||||
in-out property <image> conv_image_data;
|
||||
in-out property <State> state;
|
||||
callback conv_image_browse_clicked;
|
||||
|
||||
|
@ -84,12 +121,12 @@ export component FileTab inherits Rectangle {
|
|||
if root.state == State.Project : ProjectWidget {
|
||||
}
|
||||
if root.state == State.ConvertImage : ConvertImageWidget {
|
||||
path <=> root.conv_image_path;
|
||||
image_path <=> root.conv_image_path;
|
||||
image_data <=> root.conv_image_data;
|
||||
browse_clicked => {
|
||||
root.conv_image_browse_clicked();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue