Merge pull request #70419 from Maran23/4-x-editor-layout-dialog-improvements
Do not add child twice and set initial focus in editor layout dialog
This commit is contained in:
commit
510420efdc
2 changed files with 7 additions and 3 deletions
|
@ -98,6 +98,11 @@ void EditorLayoutsDialog::_post_popup() {
|
||||||
for (const String &E : layouts) {
|
for (const String &E : layouts) {
|
||||||
layout_names->add_item(E);
|
layout_names->add_item(E);
|
||||||
}
|
}
|
||||||
|
if (name->is_visible()) {
|
||||||
|
name->grab_focus();
|
||||||
|
} else {
|
||||||
|
layout_names->grab_focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorLayoutsDialog::EditorLayoutsDialog() {
|
EditorLayoutsDialog::EditorLayoutsDialog() {
|
||||||
|
@ -109,7 +114,6 @@ EditorLayoutsDialog::EditorLayoutsDialog() {
|
||||||
layout_names = memnew(ItemList);
|
layout_names = memnew(ItemList);
|
||||||
layout_names->set_auto_height(true);
|
layout_names->set_auto_height(true);
|
||||||
makevb->add_margin_child(TTR("Select existing layout:"), layout_names);
|
makevb->add_margin_child(TTR("Select existing layout:"), layout_names);
|
||||||
makevb->add_child(layout_names);
|
|
||||||
layout_names->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
|
layout_names->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
|
||||||
layout_names->set_visible(true);
|
layout_names->set_visible(true);
|
||||||
layout_names->set_offset(SIDE_TOP, 5);
|
layout_names->set_offset(SIDE_TOP, 5);
|
||||||
|
|
|
@ -5194,15 +5194,15 @@ void EditorNode::_layout_menu_option(int p_id) {
|
||||||
current_menu_option = p_id;
|
current_menu_option = p_id;
|
||||||
layout_dialog->set_title(TTR("Save Layout"));
|
layout_dialog->set_title(TTR("Save Layout"));
|
||||||
layout_dialog->set_ok_button_text(TTR("Save"));
|
layout_dialog->set_ok_button_text(TTR("Save"));
|
||||||
layout_dialog->popup_centered();
|
|
||||||
layout_dialog->set_name_line_enabled(true);
|
layout_dialog->set_name_line_enabled(true);
|
||||||
|
layout_dialog->popup_centered();
|
||||||
} break;
|
} break;
|
||||||
case SETTINGS_LAYOUT_DELETE: {
|
case SETTINGS_LAYOUT_DELETE: {
|
||||||
current_menu_option = p_id;
|
current_menu_option = p_id;
|
||||||
layout_dialog->set_title(TTR("Delete Layout"));
|
layout_dialog->set_title(TTR("Delete Layout"));
|
||||||
layout_dialog->set_ok_button_text(TTR("Delete"));
|
layout_dialog->set_ok_button_text(TTR("Delete"));
|
||||||
layout_dialog->popup_centered();
|
|
||||||
layout_dialog->set_name_line_enabled(false);
|
layout_dialog->set_name_line_enabled(false);
|
||||||
|
layout_dialog->popup_centered();
|
||||||
} break;
|
} break;
|
||||||
case SETTINGS_LAYOUT_DEFAULT: {
|
case SETTINGS_LAYOUT_DEFAULT: {
|
||||||
_load_docks_from_config(default_layout, "docks");
|
_load_docks_from_config(default_layout, "docks");
|
||||||
|
|
Loading…
Reference in a new issue