Turn on and off button

This commit is contained in:
2025-02-15 14:17:47 +01:00
parent d9facb8d61
commit 5a4760b272
8 changed files with 76 additions and 19 deletions

View File

@@ -15,8 +15,10 @@ component ConvertImageWidget inherits Rectangle {
in-out property <string> image_path;
in-out property <image> image_data;
in-out property <string> image_name;
in-out property <bool> enable_button: false;
callback browse_clicked();
callback add_clicked();
background: #D0D0D0;
@@ -82,7 +84,8 @@ component ConvertImageWidget inherits Rectangle {
padding: 4px;
Button {
text: "Add Image";
enabled: false;
enabled: root.enable_button;
clicked => {root.add_clicked();}
}
}
}
@@ -94,8 +97,10 @@ export component FileTab inherits Rectangle {
in-out property <string> conv_image_path;
in-out property <image> conv_image_data;
in-out property <string> conv_image_name;
in-out property <bool> conv_image_enable;
in-out property <State> state;
callback conv_image_browse_clicked;
callback conv_image_add_clicked;
x: 0px;
y: 0px;
@@ -130,9 +135,15 @@ export component FileTab inherits Rectangle {
image_path <=> root.conv_image_path;
image_data <=> root.conv_image_data;
image_name <=> root.conv_image_name;
enable_button <=> root.conv_image_enable;
browse_clicked => {
root.conv_image_browse_clicked();
}
add_clicked => {
root.conv_image_add_clicked();
}
}
}
}