From f196532de6798a4342ddd7e54779097c79590d3c Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 7 Apr 2022 17:14:53 +0800 Subject: [PATCH] Focus filter LineEdit after Theme Type dialog popup --- editor/plugins/theme_editor_plugin.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 37370e447e4..26054a8dfe2 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1947,7 +1947,6 @@ ThemeItemEditorDialog::ThemeItemEditorDialog() { void ThemeTypeDialog::_dialog_about_to_show() { add_type_filter->set_text(""); - add_type_filter->grab_focus(); _update_add_type_options(); } @@ -2027,14 +2026,13 @@ void ThemeTypeDialog::_notification(int p_what) { connect("about_to_show", this, "_dialog_about_to_show"); FALLTHROUGH; } + case NOTIFICATION_THEME_CHANGED: { _update_add_type_options(); } break; - case NOTIFICATION_VISIBILITY_CHANGED: { - if (is_visible()) { - add_type_filter->grab_focus(); - } + case NOTIFICATION_POST_POPUP: { + add_type_filter->grab_focus(); } break; } }