Prepare for palette display

This commit is contained in:
Jaby 2025-03-03 20:46:30 +01:00
parent 70cf70c4b5
commit 618b642c3f
1 changed files with 31 additions and 8 deletions

View File

@ -14,6 +14,7 @@ component ProjectWidget inherits Rectangle {
component ConvertImageWidget inherits Rectangle { component ConvertImageWidget inherits Rectangle {
in-out property <string> image_path; in-out property <string> image_path;
in-out property <image> image_data; in-out property <image> image_data;
in-out property <image> 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_button: false;
@ -48,21 +49,43 @@ component ConvertImageWidget inherits Rectangle {
} }
GroupBox { GroupBox {
title: "Loaded image"; title: "Loaded image and palette";
VerticalLayout { VerticalLayout {
alignment: start; alignment: start;
padding: 4px; padding: 4px;
HorizontalLayout { HorizontalLayout {
alignment: center; alignment: center;
Rectangle { Rectangle {
width: 256px; width: 256px + 2*4px; // < Because of border
height: 256px; height: 256px + 2*4px; // < Because of border
background: #000000; background: #404040;
border-color: #808080;
border-width: 4px;
Image { Image {
width: 256px; width: 256px;
height: 256px; height: 256px;
source: root.image_data; source: root.image_data;
image-fit: contain; image-fit: contain;
image-rendering: pixelated;
}
}
Rectangle {
// Fake padding because the padding setting for the HorizontalLayout would not work
width: 4px;
height: 1px;
}
Rectangle {
width: 256px + 2*4px; // < Because of border
height: 256px + 2*4px; // < Because of border
background: #404040;
border-color: #808080;
border-width: 4px;
Image {
width: 256px;
height: 256px;
source: root.image_palette_data;
image-fit: contain;
image-rendering: pixelated;
} }
} }
} }