Skip to content

Commit

Permalink
Merge pull request #89184 from Calinou/shader-globals-editor-add-ente…
Browse files Browse the repository at this point in the history
…r-shortcut

Add Enter shortcut to add a shader global in the editor
  • Loading branch information
akien-mga committed Mar 5, 2024
2 parents 43dce97 + 3051920 commit 3dff0e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions editor/shader_globals_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 3dff0e9

Please sign in to comment.