Editor: Scroll to focus when adding a var in Blackboard Plan editor

This commit is contained in:
Serhii Snitsaruk 2024-01-28 22:25:31 +01:00
parent c44648c69c
commit 656bc169b0
3 changed files with 7 additions and 0 deletions

View File

@ -171,6 +171,9 @@ void BlackboardPlanEditor::_add_var_pressed() {
LineEdit *name_edit = _get_name_edit(rows_vbox->get_child_count() - 1);
name_edit->grab_focus();
name_edit->select_all();
// Note: Scroll to the end, delay is necessary here.
scroll_container->call_deferred(LW_NAME(call_deferred), LW_NAME(set_v_scroll), 888888888);
}
void BlackboardPlanEditor::_drag_button_down(Control *p_row) {

View File

@ -55,6 +55,7 @@ LimboStringNames::LimboStringNames() {
BTAlwaysSucceed = SN("BTAlwaysSucceed");
button_down = SN("button_down");
button_up = SN("button_up");
call_deferred = SN("call_deferred");
changed = SN("changed");
connect = SN("connect");
dark_color_1 = SN("dark_color_1");
@ -130,6 +131,7 @@ LimboStringNames::LimboStringNames() {
separation = SN("separation");
set_custom_name = SN("set_custom_name");
set_root_task = SN("set_root_task");
set_v_scroll = SN("set_v_scroll");
setup = SN("setup");
started = SN("started");
state_changed = SN("state_changed");

View File

@ -69,6 +69,7 @@ public:
StringName BTAlwaysSucceed;
StringName button_down;
StringName button_up;
StringName call_deferred;
StringName changed;
StringName connect;
StringName dark_color_1;
@ -145,6 +146,7 @@ public:
StringName separation;
StringName set_custom_name;
StringName set_root_task;
StringName set_v_scroll;
StringName setup;
StringName started;
StringName state_changed;