瀏覽代碼

Fix: ESC (ui_cancel) not closing FindReplaceBar

stmSi 2 年之前
父節點
當前提交
7eb517c27f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/code_editor.cpp

+ 1 - 1
editor/code_editor.cpp

@@ -126,7 +126,7 @@ void FindReplaceBar::unhandled_input(const Ref<InputEvent> &p_event) {
 	if (k.is_valid() && k->is_action_pressed(SNAME("ui_cancel"), false, true)) {
 		Control *focus_owner = get_viewport()->gui_get_focus_owner();
 
-		if (text_editor->has_focus() || (focus_owner && vbc_lineedit->is_ancestor_of(focus_owner))) {
+		if (text_editor->has_focus() || (focus_owner && is_ancestor_of(focus_owner))) {
 			_hide_bar();
 			accept_event();
 		}