mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix closing project setting window with ESC while listening for input
This is done by disallowing ESC to be used for closing the window while the filter-LineEdit is focused.
This commit is contained in:
parent
63f95c0e58
commit
3238d11247
4 changed files with 29 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
#include "editor/input_event_configuration_dialog.h"
|
||||
#include "scene/gui/check_button.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "scene/scene_string_names.h"
|
||||
|
||||
static bool _is_action_name_valid(const String &p_name) {
|
||||
const char32_t *cstr = p_name.get_data();
|
||||
|
@ -362,6 +363,8 @@ void ActionMapEditor::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo("action_removed", PropertyInfo(Variant::STRING, "name")));
|
||||
ADD_SIGNAL(MethodInfo("action_renamed", PropertyInfo(Variant::STRING, "old_name"), PropertyInfo(Variant::STRING, "new_name")));
|
||||
ADD_SIGNAL(MethodInfo("action_reordered", PropertyInfo(Variant::STRING, "action_name"), PropertyInfo(Variant::STRING, "relative_to"), PropertyInfo(Variant::BOOL, "before")));
|
||||
ADD_SIGNAL(MethodInfo(SNAME("filter_focused")));
|
||||
ADD_SIGNAL(MethodInfo(SNAME("filter_unfocused")));
|
||||
}
|
||||
|
||||
LineEdit *ActionMapEditor::get_search_box() const {
|
||||
|
@ -492,6 +495,14 @@ void ActionMapEditor::use_external_search_box(LineEdit *p_searchbox) {
|
|||
action_list_search->connect("text_changed", callable_mp(this, &ActionMapEditor::_search_term_updated));
|
||||
}
|
||||
|
||||
void ActionMapEditor::_on_filter_focused() {
|
||||
emit_signal(SNAME("filter_focused"));
|
||||
}
|
||||
|
||||
void ActionMapEditor::_on_filter_unfocused() {
|
||||
emit_signal(SNAME("filter_unfocused"));
|
||||
}
|
||||
|
||||
ActionMapEditor::ActionMapEditor() {
|
||||
// Main Vbox Container
|
||||
VBoxContainer *main_vbox = memnew(VBoxContainer);
|
||||
|
@ -512,6 +523,8 @@ ActionMapEditor::ActionMapEditor() {
|
|||
action_list_search_by_event->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
action_list_search_by_event->set_stretch_ratio(0.75);
|
||||
action_list_search_by_event->connect("event_changed", callable_mp(this, &ActionMapEditor::_search_by_event));
|
||||
action_list_search_by_event->connect(SceneStringNames::get_singleton()->focus_entered, callable_mp(this, &ActionMapEditor::_on_filter_focused));
|
||||
action_list_search_by_event->connect(SceneStringNames::get_singleton()->focus_exited, callable_mp(this, &ActionMapEditor::_on_filter_unfocused));
|
||||
top_hbox->add_child(action_list_search_by_event);
|
||||
|
||||
Button *clear_all_search = memnew(Button);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue