Skip to content

Commit 29d8b3d

Browse files
committed
Fix first time popup losing focus when selecting paths
1 parent b930361 commit 29d8b3d

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

scenes/popups/first_time/GamesSection.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func _on_NextButton_pressed():
3434
func _on_ChooseDir_pressed():
3535
RetroHubUI.request_folder_load(n_path.text)
3636
set_path(await RetroHubUI.path_selected)
37+
get_window().grab_focus()
3738

3839
func set_path(path: String):
3940
if not path.is_empty():
@@ -60,6 +61,7 @@ func query_next_btn():
6061
func _on_media_choose_dir_pressed():
6162
RetroHubUI.request_folder_load(n_media_path.text)
6263
set_media_path(await RetroHubUI.path_selected)
64+
get_window().grab_focus()
6365

6466
func set_media_path(path: String):
6567
if not path.is_empty():

scenes/popups/first_time/GamesSection.tscn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ layout_mode = 2
5858
size_flags_horizontal = 3
5959
text = "Store downloaded media in the configuration directory?"
6060

61+
[node name="AccessibilityFocus" type="Node" parent="VBoxContainer/HBoxContainer2/Label"]
62+
script = ExtResource("3")
63+
6164
[node name="UseCustomMedia" type="CheckButton" parent="VBoxContainer/HBoxContainer2"]
6265
unique_name_in_owner = true
6366
layout_mode = 2
@@ -77,6 +80,9 @@ layout_mode = 2
7780
layout_mode = 2
7881
text = "Game media location"
7982

83+
[node name="AccessibilityFocus" type="Node" parent="VBoxContainer/CustomMediaContainer/VBoxContainer/Label"]
84+
script = ExtResource("3")
85+
8086
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/CustomMediaContainer/VBoxContainer"]
8187
layout_mode = 2
8288
theme_override_constants/separation = 15

source/UI.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func _on_popup_selected(file: String):
100100
emit_signal("path_selected", file)
101101

102102
func _on_visibility_changed():
103-
if not visible:
103+
if not _n_filesystem_popup.visible:
104104
emit_signal("path_selected", "")
105105

106106
func filesystem_filters(filters: Array = []):

0 commit comments

Comments
 (0)