diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-05 23:44:39 +0100 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-05 23:44:39 +0100 |
| commit | 3dff0e9eed7820396bfdb130fce818c054bf51c2 (patch) | |
| tree | b0057fac6050598f510015080655e56202a58806 | |
| parent | 43dce97a64d7411b13502981c45460c03e2176b1 (diff) | |
| parent | 305192072fab1c4d5894ba5da3009a648936c70b (diff) | |
| download | redot-engine-3dff0e9eed7820396bfdb130fce818c054bf51c2.tar.gz | |
Merge pull request #89184 from Calinou/shader-globals-editor-add-enter-shortcut
Add Enter shortcut to add a shader global in the editor
| -rw-r--r-- | editor/shader_globals_editor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/shader_globals_editor.cpp b/editor/shader_globals_editor.cpp index 97f6ce2215..86a78d813e 100644 --- a/editor/shader_globals_editor.cpp +++ b/editor/shader_globals_editor.cpp @@ -398,6 +398,8 @@ void ShaderGlobalsEditor::_variable_added() { undo_redo->add_do_method(this, "_changed"); undo_redo->add_undo_method(this, "_changed"); undo_redo->commit_action(); + + variable_name->clear(); } void ShaderGlobalsEditor::_variable_deleted(const String &p_variable) { @@ -455,6 +457,7 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() { variable_name->set_h_size_flags(SIZE_EXPAND_FILL); variable_name->set_clear_button_enabled(true); variable_name->connect("text_changed", callable_mp(this, &ShaderGlobalsEditor::_variable_name_text_changed)); + variable_name->connect("text_submitted", callable_mp(this, &ShaderGlobalsEditor::_variable_added).unbind(1)); add_menu_hb->add_child(variable_name); |
