Merge pull request #103734 from KoBeWi/catch_fokus_200

Re-grab FileSystem focus after rescan
This commit is contained in:
Rémi Verschelde 2025-03-14 00:08:41 +01:00
commit 3751a4a026
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 11 additions and 0 deletions

View file

@ -1331,6 +1331,10 @@ void FileSystemDock::_fs_changed() {
}
set_process(false);
if (had_focus) {
had_focus->grab_focus();
had_focus = nullptr;
}
}
void FileSystemDock::_set_scanning_mode() {
@ -2676,6 +2680,12 @@ bool FileSystemDock::_matches_all_search_tokens(const String &p_text) {
}
void FileSystemDock::_rescan() {
if (tree->has_focus()) {
had_focus = tree;
} else if (files->has_focus()) {
had_focus = files;
}
_set_scanning_mode();
EditorFileSystem::get_singleton()->scan();
}

View file

@ -234,6 +234,7 @@ private:
bool import_dock_needs_update = false;
TreeItem *resources_item = nullptr;
TreeItem *favorites_item = nullptr;
Control *had_focus = nullptr;
bool holding_branch = false;
Vector<TreeItem *> tree_items_selected_on_drag_begin;