From f68ef482967bf9879562db09fb183c6bab779c31 Mon Sep 17 00:00:00 2001 From: Jaby Date: Mon, 17 Feb 2025 10:55:20 +0100 Subject: [PATCH] GUI improvements --- src/Tools/tim_tool/ui/tab/main-tab.slint | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Tools/tim_tool/ui/tab/main-tab.slint b/src/Tools/tim_tool/ui/tab/main-tab.slint index dc3b1a0f..2f0e6c66 100644 --- a/src/Tools/tim_tool/ui/tab/main-tab.slint +++ b/src/Tools/tim_tool/ui/tab/main-tab.slint @@ -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; } } }