Skip to content

Commit

Permalink
Small fixes to GoodFileDialog (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
MewPurPur authored Apr 13, 2024
1 parent 881d657 commit a8c6cbc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ui_parts/good_file_dialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func file_sort(file1: String, file2: String) -> bool:
func set_dir(dir: String) -> void:
file_list.clear()
# Basic setup.
unfocus_file()
current_dir = dir
path_field.text = current_dir
# Rebuild the system dirs to see if we now need to highlight the relevant one.
Expand Down Expand Up @@ -176,6 +177,8 @@ func set_dir(dir: String) -> void:
var item_idx := file_list.add_item(file, null)
file_list.set_item_metadata(item_idx,
Actions.new(select_file, focus_file.bind(file)))
# If we don't await this stuff, sometimes the item_rect we get is all wrong.
await file_list.draw
await get_tree().process_frame
_setup_file_images()

Expand Down

0 comments on commit a8c6cbc

Please sign in to comment.