summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-12 14:23:06 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-12 14:23:06 +0100
commitb18942d429c23112c3e01aa1649c1704eaf86d0d (patch)
tree48a68adb5581917bd8411e20c76314eb12cfeb2b
parent061e0c758ddbb569c63b918d2b3e613f6aa5b6b7 (diff)
parentc1a034297dcd2304b3eabad4d1493194ce867b05 (diff)
downloadredot-engine-b18942d429c23112c3e01aa1649c1704eaf86d0d.tar.gz
Merge pull request #89405 from KoBeWi/receiver,_do_you_copy
Select method name edit when opening connection dialog
-rw-r--r--editor/connections_dialog.cpp11
-rw-r--r--editor/connections_dialog.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index f49a373d04..ed90b796f7 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -159,10 +159,6 @@ void ConnectDialog::_item_activated() {
_ok_pressed(); // From AcceptDialog.
}
-void ConnectDialog::_text_submitted(const String &p_text) {
- _ok_pressed(); // From AcceptDialog.
-}
-
/*
* Called each time a target node is selected within the target node tree.
*/
@@ -451,6 +447,11 @@ void ConnectDialog::_update_warning_label() {
warning_label->set_visible(true);
}
+void ConnectDialog::_post_popup() {
+ callable_mp((Control *)dst_method, &Control::grab_focus).call_deferred();
+ callable_mp(dst_method, &LineEdit::select_all).call_deferred();
+}
+
void ConnectDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
@@ -825,8 +826,8 @@ ConnectDialog::ConnectDialog() {
dst_method = memnew(LineEdit);
dst_method->set_h_size_flags(Control::SIZE_EXPAND_FILL);
dst_method->connect("text_changed", callable_mp(method_tree, &Tree::deselect_all).unbind(1));
- dst_method->connect("text_submitted", callable_mp(this, &ConnectDialog::_text_submitted));
hbc_method->add_child(dst_method);
+ register_text_enter(dst_method);
open_method_tree = memnew(Button);
hbc_method->add_child(open_method_tree);
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index 8aa44dc91d..f644d3335a 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -140,7 +140,6 @@ private:
void ok_pressed() override;
void _cancel_pressed();
void _item_activated();
- void _text_submitted(const String &p_text);
void _tree_node_selected();
void _focus_currently_connected();
@@ -159,6 +158,7 @@ private:
void _update_warning_label();
protected:
+ virtual void _post_popup() override;
void _notification(int p_what);
static void _bind_methods();