Merge pull request #65400 from m4gr3d/disable_android_editor_auto_focus_3x

This commit is contained in:
Rémi Verschelde 2022-09-06 10:14:55 +02:00 committed by GitHub
commit bc14fc7039
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -584,10 +584,12 @@ void EditorAssetLibrary::_notification(int p_what) {
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) {
#ifndef ANDROID_ENABLED
// Focus the search box automatically when switching to the Templates tab (in the Project Manager)
// or switching to the AssetLib tab (in the editor).
// The Project Manager's project filter box is automatically focused in the project manager code.
filter->grab_focus();
#endif
if (initial_loading) {
_repository_changed(0); // Update when shown for the first time.

View file

@ -469,7 +469,9 @@ void ScriptTextEditor::set_edit_state(const Variant &p_state) {
}
if (editor_enabled) {
#ifndef ANDROID_ENABLED
ensure_focus();
#endif
}
}

View file

@ -1791,11 +1791,13 @@ void ProjectManager::_notification(int p_what) {
}
} break;
case NOTIFICATION_READY: {
#ifndef ANDROID_ENABLED
if (_project_list->get_project_count() >= 1) {
// Focus on the search box immediately to allow the user
// to search without having to reach for their mouse
project_filter->search_box->grab_focus();
}
#endif
if (asset_library) {
// Suggest browsing asset library to get templates/demos.
@ -2332,6 +2334,7 @@ void ProjectManager::_on_filter_option_changed() {
}
void ProjectManager::_on_tab_changed(int p_tab) {
#ifndef ANDROID_ENABLED
if (p_tab == 0) { // Projects
// Automatically grab focus when the user moves from the Templates tab
// back to the Projects tab.
@ -2343,6 +2346,7 @@ void ProjectManager::_on_tab_changed(int p_tab) {
// The Templates tab's search field is focused on display in the asset
// library editor plugin code.
#endif
}
void ProjectManager::_bind_methods() {