Fix various focus issues

This commit is contained in:
Jaby 2025-04-05 22:34:30 +02:00
parent af633a4fdf
commit 32da34cad6
2 changed files with 9 additions and 3 deletions

View File

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

View File

@ -29,8 +29,9 @@ export component MainTab inherits Rectangle {
callback remove_file_clicked(int);
callback move_vram_image(int, int, int);
width: group.width + group.x*2;
height: group.height + group.y*2 + 32px;
width: group.width + group.x*2;
height: group.height + group.y*2 + 32px;
forward-focus: key_focus;
group := GroupBox {
title: "VRAM Layout";
@ -293,7 +294,7 @@ export component MainTab inherits Rectangle {
}
}
FocusScope {
key_focus := FocusScope {
key-pressed(event) => {
if(vram_files_list.current-item != -1) {
if(event.text == Key.LeftArrow) {
@ -330,4 +331,8 @@ export component MainTab inherits Rectangle {
cur_sel_y.text = 0;
cur_sel_img.visible = false;
}
public function set_active() {
key_focus.focus();
}
}