Support loading and displaying of image palette #16

Merged
jaby merged 17 commits from topic/jb/tim_tool/PaletteSupport into main 2025-03-06 18:11:51 +00:00
1 changed files with 31 additions and 8 deletions
Showing only changes of commit 618b642c3f - Show all commits

View File

@ -14,6 +14,7 @@ component ProjectWidget inherits Rectangle {
component ConvertImageWidget inherits Rectangle {
in-out property <string> image_path;
in-out property <image> image_data;
in-out property <image> image_palette_data;
in-out property <string> image_name;
in-out property <bool> enable_button: false;
@ -48,21 +49,43 @@ component ConvertImageWidget inherits Rectangle {
}
GroupBox {
title: "Loaded image";
title: "Loaded image and palette";
VerticalLayout {
alignment: start;
padding: 4px;
HorizontalLayout {
alignment: center;
Rectangle {
width: 256px;
height: 256px;
background: #000000;
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_data;
image-fit: contain;
width: 256px;
height: 256px;
source: root.image_data;
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;
}
}
}