From 7a2052575dcce96d2cd09af3e66f78d75d2b76c8 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sat, 5 Apr 2025 22:57:21 +0200 Subject: [PATCH] Prepare file settings box --- src/Tools/tim_tool/ui/tab/main-tab.slint | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Tools/tim_tool/ui/tab/main-tab.slint b/src/Tools/tim_tool/ui/tab/main-tab.slint index 8f0c48cf..c2b9de49 100644 --- a/src/Tools/tim_tool/ui/tab/main-tab.slint +++ b/src/Tools/tim_tool/ui/tab/main-tab.slint @@ -97,6 +97,14 @@ export component MainTab inherits Rectangle { encoding_text.encoding_str = vram_data.info.encoding_str; cur_sel_img.visible = true; + if !vram-data.info.is_palette { + file_settings_box.set_active(i); + } + + else { + file_settings_box.set_inactive(); + } + vram_files_list.current-item = i; } } @@ -182,6 +190,14 @@ export component MainTab inherits Rectangle { cur_sel_img.source = root.vram_data[current-item].images.full_image; encoding_text.encoding_str = root.vram_data[current-item].info.encoding_str; cur_sel_img.visible = true; + + if !root.vram_data[current-item].info.is_palette { + file_settings_box.set_active(current-item); + } + + else { + file_settings_box.set_inactive(); + } } item-pointer-event(item, event, position) => { @@ -290,6 +306,18 @@ export component MainTab inherits Rectangle { } } } + file_settings_box := GroupBox { + title: "File settings"; + enabled: false; + + public function set_active(item: int) { + self.enabled = true; + } + + public function set_inactive() { + self.enabled = false; + } + } } } }