From 1e86738f0454f89a39f1dcb9ec44867a4c692cdd 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 5ae87712..20037209 100644 --- a/src/Tools/tim_tool/ui/tab/main-tab.slint +++ b/src/Tools/tim_tool/ui/tab/main-tab.slint @@ -96,6 +96,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; } } @@ -171,6 +179,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) => { @@ -279,6 +295,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; + } + } } } }