1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Editor: Focus value editor on type change in Dictionary and Array editors

This commit is contained in:
Valentin Cocaud
2024-02-14 14:14:21 +01:00
parent 7b63ac488e
commit c31111f5ec
4 changed files with 42 additions and 3 deletions

View File

@@ -652,6 +652,19 @@ void EditorProperty::add_focusable(Control *p_control) {
focusables.push_back(p_control);
}
void EditorProperty::grab_focus(int p_focusable) {
if (focusables.is_empty()) {
return;
}
if (p_focusable >= 0) {
ERR_FAIL_INDEX(p_focusable, focusables.size());
focusables[p_focusable]->grab_focus();
} else {
focusables[0]->grab_focus();
}
}
void EditorProperty::select(int p_focusable) {
bool already_selected = selected;
if (!selectable) {