Add GUI for palette width/height

This commit is contained in:
Jaby 2025-03-04 20:40:50 +01:00
parent 1f8fc5100c
commit e948887faa
2 changed files with 47 additions and 18 deletions

View File

@ -18,7 +18,7 @@ export component MainWindow inherits Window {
in-out property file_tab_palette_data <=> file_tab.conv_palette_data; in-out property file_tab_palette_data <=> file_tab.conv_palette_data;
in-out property file_tab_palette_visible <=> file_tab.conv_palette_enable; in-out property file_tab_palette_visible <=> file_tab.conv_palette_enable;
in-out property file_tab_image_name <=> file_tab.conv_image_name; in-out property file_tab_image_name <=> file_tab.conv_image_name;
in-out property file_tab_enable <=> file_tab.conv_image_enable; in-out property file_tab_enable <=> file_tab.conv_enable_view;
callback file_tab_browse_convert_image <=> file_tab.conv_image_browse_clicked; callback file_tab_browse_convert_image <=> file_tab.conv_image_browse_clicked;
callback file_tab_add_convert_image <=> file_tab.conv_image_add_clicked; callback file_tab_add_convert_image <=> file_tab.conv_image_add_clicked;

View File

@ -16,7 +16,7 @@ component ConvertImageWidget inherits Rectangle {
in-out property <image> image_data; in-out property <image> image_data;
in-out property <image> palette_data; in-out property <image> palette_data;
in-out property <string> image_name; in-out property <string> image_name;
in-out property <bool> enable_button: false; in-out property <bool> enable_view: false;
in-out property <bool> palette_visible: false; in-out property <bool> palette_visible: false;
callback browse_clicked(); callback browse_clicked();
@ -75,6 +75,7 @@ component ConvertImageWidget inherits Rectangle {
width: 4px; width: 4px;
height: 1px; height: 1px;
} }
VerticalLayout {
Rectangle { Rectangle {
width: 256px + 2*4px; // < Because of border width: 256px + 2*4px; // < Because of border
height: 256px + 2*4px; // < Because of border height: 256px + 2*4px; // < Because of border
@ -90,6 +91,34 @@ component ConvertImageWidget inherits Rectangle {
image-rendering: pixelated; image-rendering: pixelated;
} }
} }
HorizontalLayout {
alignment: start;
VerticalLayout {
VerticalLayout {
alignment: center;
Text {
text: "Width: ";
}
}
VerticalLayout {
alignment: center;
Text {
text: "Height: ";
}
}
}
VerticalLayout {
LineEdit {
width: 40pt;
enabled: root.enable_view;
}
LineEdit {
width: 40pt;
enabled: root.enable_view;
}
}
}
}
} }
HorizontalLayout { HorizontalLayout {
alignment: start; alignment: start;
@ -109,7 +138,7 @@ component ConvertImageWidget inherits Rectangle {
padding: 4px; padding: 4px;
Button { Button {
text: "Add Image"; text: "Add Image";
enabled: root.enable_button; enabled: root.enable_view;
clicked => {root.add_clicked();} clicked => {root.add_clicked();}
} }
} }
@ -133,7 +162,7 @@ export component FileTab inherits Rectangle {
in-out property <image> conv_palette_data; in-out property <image> conv_palette_data;
in-out property <bool> conv_palette_enable; in-out property <bool> conv_palette_enable;
in-out property <string> conv_image_name; in-out property <string> conv_image_name;
in-out property <bool> conv_image_enable; in-out property <bool> conv_enable_view;
in-out property <State> state; in-out property <State> state;
callback conv_image_browse_clicked; callback conv_image_browse_clicked;
callback conv_image_add_clicked; callback conv_image_add_clicked;
@ -173,7 +202,7 @@ export component FileTab inherits Rectangle {
palette_data <=> root.conv_palette_data; palette_data <=> root.conv_palette_data;
palette_visible <=> root.conv_palette_enable; palette_visible <=> root.conv_palette_enable;
image_name <=> root.conv_image_name; image_name <=> root.conv_image_name;
enable_button <=> root.conv_image_enable; enable_view <=> root.conv_enable_view;
browse_clicked => { browse_clicked => {
root.conv_image_browse_clicked(); root.conv_image_browse_clicked();