Compare commits

..

4 Commits

Author SHA1 Message Date
cody a1fa0aace2 Merge branch 'main' into topic/jb/tim-tool_additional-settings 2025-04-08 19:11:53 +00:00
Jaby a475a0c82d Bump dependency versions 2025-04-05 22:38:14 +02:00
Jaby 32da34cad6 Fix various focus issues 2025-04-05 22:34:30 +02:00
Jaby af633a4fdf Fix scoll issue 2025-04-05 22:22:33 +02:00
4 changed files with 1310 additions and 382 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,15 +9,15 @@ panic = "abort"
[dependencies] [dependencies]
pathdiff = "0.2.3" pathdiff = "0.2.3"
png = "0.17.16" png = "0.17.16"
rfd = "0.15.2" rfd = "0.15.3"
slint = "1.9.2" slint = "1.10.0"
serde = {version = "1.0.140", features = ["derive"]} serde = {version = "1.0.219", features = ["derive"]}
serde_json = "1.0" serde_json = "1.0"
tiny-skia = "0.11.4" tiny-skia = "0.11.4"
tool_helper = {path = "../tool_helper"} tool_helper = {path = "../tool_helper"}
[build-dependencies] [build-dependencies]
slint-build = "1.9.2" slint-build = "1.10.0"
[package.metadata.bundle] [package.metadata.bundle]
name = "TIMTOOL" name = "TIMTOOL"

View File

@ -81,6 +81,7 @@ export component MainWindow inherits Window {
public function change_to_main() { public function change_to_main() {
tab_widget.current-index = 1; tab_widget.current-index = 1;
main_tab.set_active();
} }
public function clear_file_tab-current_selected_file() { public function clear_file_tab-current_selected_file() {

View File

@ -33,6 +33,7 @@ export component MainTab inherits Rectangle {
width: group.width + group.x*2; width: group.width + group.x*2;
height: group.height + group.y*2 + 32px; height: group.height + group.y*2 + 32px;
forward-focus: key_focus;
group := GroupBox { group := GroupBox {
title: "VRAM Layout"; title: "VRAM Layout";
@ -131,10 +132,20 @@ export component MainTab inherits Rectangle {
} }
function update_viewport() { function update_viewport() {
// If this value is positive, then the image moved so much to the right, that we do not use the full display area anymore
if self.viewport-x > 0 {
self.viewport-x = 0;
}
if abs(self.viewport-x) + self.width > self.viewport-width { if abs(self.viewport-x) + self.width > self.viewport-width {
self.viewport-x += (self.width + abs(self.viewport-x)) - self.viewport-width; self.viewport-x += (self.width + abs(self.viewport-x)) - self.viewport-width;
} }
if self.viewport-y > 0 {
self.viewport-y = 0;
}
// If this value is positive, then the image moved so much down, that we do not use the full display area anymore
if abs(self.viewport-y) + self.height > self.viewport-height { if abs(self.viewport-y) + self.height > self.viewport-height {
self.viewport-y += (self.height + abs(self.viewport-y)) - self.viewport-height; self.viewport-y += (self.height + abs(self.viewport-y)) - self.viewport-height;
} }
@ -349,7 +360,7 @@ export component MainTab inherits Rectangle {
} }
} }
FocusScope { key_focus := FocusScope {
key-pressed(event) => { key-pressed(event) => {
if(vram_files_list.current-item != -1) { if(vram_files_list.current-item != -1) {
if(event.text == Key.LeftArrow) { if(event.text == Key.LeftArrow) {
@ -386,4 +397,8 @@ export component MainTab inherits Rectangle {
cur_sel_y.text = 0; cur_sel_y.text = 0;
cur_sel_img.visible = false; cur_sel_img.visible = false;
} }
public function set_active() {
key_focus.focus();
}
} }