Skip to content

Commit

Permalink
Fix first time popup losing focus when selecting paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rsubtil committed May 25, 2024
1 parent b930361 commit 29d8b3d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions scenes/popups/first_time/GamesSection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func _on_NextButton_pressed():
func _on_ChooseDir_pressed():
RetroHubUI.request_folder_load(n_path.text)
set_path(await RetroHubUI.path_selected)
get_window().grab_focus()

func set_path(path: String):
if not path.is_empty():
Expand All @@ -60,6 +61,7 @@ func query_next_btn():
func _on_media_choose_dir_pressed():
RetroHubUI.request_folder_load(n_media_path.text)
set_media_path(await RetroHubUI.path_selected)
get_window().grab_focus()

func set_media_path(path: String):
if not path.is_empty():
Expand Down
6 changes: 6 additions & 0 deletions scenes/popups/first_time/GamesSection.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ layout_mode = 2
size_flags_horizontal = 3
text = "Store downloaded media in the configuration directory?"

[node name="AccessibilityFocus" type="Node" parent="VBoxContainer/HBoxContainer2/Label"]
script = ExtResource("3")

[node name="UseCustomMedia" type="CheckButton" parent="VBoxContainer/HBoxContainer2"]
unique_name_in_owner = true
layout_mode = 2
Expand All @@ -77,6 +80,9 @@ layout_mode = 2
layout_mode = 2
text = "Game media location"

[node name="AccessibilityFocus" type="Node" parent="VBoxContainer/CustomMediaContainer/VBoxContainer/Label"]
script = ExtResource("3")

[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/CustomMediaContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 15
Expand Down
2 changes: 1 addition & 1 deletion source/UI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func _on_popup_selected(file: String):
emit_signal("path_selected", file)

func _on_visibility_changed():
if not visible:
if not _n_filesystem_popup.visible:
emit_signal("path_selected", "")

func filesystem_filters(filters: Array = []):
Expand Down

0 comments on commit 29d8b3d

Please sign in to comment.