diff options
Diffstat (limited to 'editor/editor_file_dialog.cpp')
-rw-r--r-- | editor/editor_file_dialog.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index bea5c99c1a..b5300bdc1b 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -608,7 +608,8 @@ void EditorFileDialog::_item_list_item_rmb_selected(int p_item, const Vector2 &p } if (item_menu->get_item_count() > 0) { - item_menu->set_position(item_list->get_global_position() + p_pos); + item_menu->set_position(item_list->get_screen_position() + p_pos); + item_menu->reset_size(); item_menu->popup(); } } @@ -629,7 +630,8 @@ void EditorFileDialog::_item_list_rmb_clicked(const Vector2 &p_pos) { item_menu->add_separator(); item_menu->add_icon_item(item_list->get_theme_icon(SNAME("Filesystem"), SNAME("EditorIcons")), TTR("Open in File Manager"), ITEM_MENU_SHOW_IN_EXPLORER); - item_menu->set_position(item_list->get_global_position() + p_pos); + item_menu->set_position(item_list->get_screen_position() + p_pos); + item_menu->reset_size(); item_menu->popup(); } @@ -761,10 +763,11 @@ void EditorFileDialog::update_file_list() { List<String> files; List<String> dirs; - String item; + String item = dir_access->get_next(); - while ((item = dir_access->get_next()) != "") { + while (!item.is_empty()) { if (item == "." || item == "..") { + item = dir_access->get_next(); continue; } @@ -775,6 +778,7 @@ void EditorFileDialog::update_file_list() { dirs.push_back(item); } } + item = dir_access->get_next(); } dirs.sort_custom<NaturalNoCaseComparator>(); |