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 18 additions and 6 deletions
Showing only changes of commit f68ef48296 - Show all commits

View File

@ -44,9 +44,9 @@ export component MainTab inherits Rectangle {
for vram_image[i] in root.vram_images: VRAMArea {
x: root.get_border_width()*1px;
y: root.get_border_width()*1px;
img: vram-image.img;
img_x: vram-image.x;
img_y: vram-image.y;
img: vram_image.img;
img_x: vram_image.x;
img_y: vram_image.y;
TouchArea {
x: (parent.img_x + self.lines_crossed_x())*1px;
y: (parent.img_y + self.lines_crossed_y())*1px;
@ -65,9 +65,11 @@ export component MainTab inherits Rectangle {
}
if event.kind == PointerEventKind.down {
cur_sel_x.display_value = parent.img_x;
cur_sel_y.display_value = parent.img_y;
cur_sel_img.source = parent.img;
cur_sel_x.display_value = parent.img_x;
cur_sel_y.display_value = parent.img_y;
cur_sel_img.source = parent.img;
cur_sel_img.visible = true;
vram_files_list.current-item = i;
}
}
@ -101,6 +103,13 @@ export component MainTab inherits Rectangle {
width: background_image.width/2;
height: 128px;
model: root.vram_files;
current-item-changed(current-item) => {
cur_sel_x.display_value = root.vram_images[current-item].x;
cur_sel_y.display_value = root.vram_images[current-item].y;
cur_sel_img.source = root.vram_images[current-item].img;
cur_sel_img.visible = true;
}
}
HorizontalLayout {
padding: 4px;
@ -113,6 +122,9 @@ export component MainTab inherits Rectangle {
clicked => {
root.remove_file_clicked(vram_files_list.current_item);
vram_files_list.current-item = -1;
cur_sel_x.display_value = 0;
cur_sel_y.display_value = 0;
cur_sel_img.visible = false;
}
}
}