diff --git a/src/Tools/tim_tool/Cargo.lock b/src/Tools/tim_tool/Cargo.lock index ed25e7f2..d2695a43 100644 --- a/src/Tools/tim_tool/Cargo.lock +++ b/src/Tools/tim_tool/Cargo.lock @@ -4115,7 +4115,7 @@ dependencies = [ [[package]] name = "tim_tool" -version = "0.1.0" +version = "1.0.0" dependencies = [ "pathdiff", "png", diff --git a/src/Tools/tim_tool/Cargo.toml b/src/Tools/tim_tool/Cargo.toml index af703be9..eadee97f 100644 --- a/src/Tools/tim_tool/Cargo.toml +++ b/src/Tools/tim_tool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tim_tool" -version = "0.1.0" +version = "1.0.0" edition = "2021" [profile.release] diff --git a/src/Tools/tim_tool/ui/tab/file-tab.slint b/src/Tools/tim_tool/ui/tab/file-tab.slint index e5ad28eb..43d4dc31 100644 --- a/src/Tools/tim_tool/ui/tab/file-tab.slint +++ b/src/Tools/tim_tool/ui/tab/file-tab.slint @@ -261,7 +261,7 @@ component ConvertImageWidget inherits Rectangle { } } LineEdit { - text: root.image_name; + text <=> root.image_name; } } HorizontalLayout { diff --git a/src/Tools/tim_tool/ui/tab/main-tab.slint b/src/Tools/tim_tool/ui/tab/main-tab.slint index 6bff7047..5ae87712 100644 --- a/src/Tools/tim_tool/ui/tab/main-tab.slint +++ b/src/Tools/tim_tool/ui/tab/main-tab.slint @@ -90,6 +90,8 @@ export component MainTab inherits Rectangle { if event.kind == PointerEventKind.down { cur_sel_x.text = parent.img_x; cur_sel_y.text = parent.img_y; + cur_sel_width.text = "Width: " + vram_data.images.image.width; + cur_sel_height.text = "Height: " + vram_data.images.image.height; cur_sel_img.source = vram_data.images.full_image; encoding_text.encoding_str = vram_data.info.encoding_str; cur_sel_img.visible = true; @@ -139,7 +141,7 @@ export component MainTab inherits Rectangle { } slider := Slider { minimum: 100.0; - maximum: 400.0; + maximum: 800.0; step: 1.0; value: 100.0; @@ -164,10 +166,27 @@ export component MainTab inherits Rectangle { current-item-changed(current-item) => { cur_sel_x.text = root.vram_data[current-item].info.x; cur_sel_y.text = root.vram_data[current-item].info.y; + cur_sel_width.text = "Width: " + root.vram_data[current-item].images.image.width; + cur_sel_height.text = "Height: " + root.vram_data[current-item].images.image.height; 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; } + + item-pointer-event(item, event, position) => { + if event.button == PointerEventButton.right && event.kind == PointerEventKind.down { + main_view.viewport-x = -(root.vram_data[item].info.x + (root.vram_data[item].info.x/64))*root.scale*1px + (main_view.width/4); + main_view.viewport-y = -(root.vram_data[item].info.y + (root.vram_data[item].info.y/256))*root.scale*1px + (main_view.height/4); + main_view.update_viewport(); + } + } + } + HorizontalLayout { + padding: 4px; + alignment: center; + Text { + text: "Right click to focus element on screen"; + } } HorizontalLayout { padding: 4px; @@ -211,7 +230,7 @@ export component MainTab inherits Rectangle { cur_sel_x := LineEdit { input-type: number; text: 0; - width: 64pt; + width: 48pt; accepted(text) => { if(vram_files_list.current-item != -1) { @@ -220,6 +239,12 @@ export component MainTab inherits Rectangle { } } } + VerticalLayout { + alignment: center; + cur_sel_width := Text { + text: "Width: 0"; + } + } } HorizontalLayout { alignment: start; @@ -232,7 +257,7 @@ export component MainTab inherits Rectangle { cur_sel_y := LineEdit { input-type: number; text: 0; - width: 64pt; + width: 48pt; accepted(text) => { if(vram_files_list.current-item != -1) { @@ -241,6 +266,12 @@ export component MainTab inherits Rectangle { } } } + VerticalLayout { + alignment: center; + cur_sel_height := Text { + text: "Height: 0"; + } + } } encoding_text := Text { in-out property encoding_str;