TIM-Tool: Fix scroll bug when centering #25
File diff suppressed because it is too large
Load Diff
|
@ -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"
|
||||||
|
@ -28,4 +28,4 @@ category = "Developer Tool"
|
||||||
short_description = "TIM Tool for JabyEngine"
|
short_description = "TIM Tool for JabyEngine"
|
||||||
long_description = """
|
long_description = """
|
||||||
A new interpetation of the TIM Tool from Sony, for use with PSYQ and the JabyEngine
|
A new interpetation of the TIM Tool from Sony, for use with PSYQ and the JabyEngine
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -29,8 +29,9 @@ export component MainTab inherits Rectangle {
|
||||||
callback remove_file_clicked(int);
|
callback remove_file_clicked(int);
|
||||||
callback move_vram_image(int, int, int);
|
callback move_vram_image(int, int, int);
|
||||||
|
|
||||||
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";
|
||||||
|
@ -121,10 +122,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;
|
||||||
}
|
}
|
||||||
|
@ -283,7 +294,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) {
|
||||||
|
@ -320,4 +331,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();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue