diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:55:06 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:55:06 +0100 |
commit | 33c7c8020a7c1b4103642ff5124b2b76ecdeea14 (patch) | |
tree | 92b930936d793f4adac2727a60070bac14967bf7 /editor | |
parent | 6946bc56ef422ae2de51200297f626c4751b06f5 (diff) | |
parent | 3aed3edc0677c59ebd96175410d9cc1f5427c053 (diff) |
Merge pull request #67489 from timothyqiu/auto-select-all
Allow selecting SpinBox & LineEdit text when focus enters
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 7004e4d3a2..9cbdd35c93 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -116,6 +116,7 @@ public: grid_offset_x->set_allow_greater(true); grid_offset_x->set_suffix("px"); grid_offset_x->set_h_size_flags(Control::SIZE_EXPAND_FILL); + grid_offset_x->set_select_all_on_focus(true); child_container->add_child(grid_offset_x); grid_offset_y = memnew(SpinBox); @@ -125,6 +126,7 @@ public: grid_offset_y->set_allow_greater(true); grid_offset_y->set_suffix("px"); grid_offset_y->set_h_size_flags(Control::SIZE_EXPAND_FILL); + grid_offset_y->set_select_all_on_focus(true); child_container->add_child(grid_offset_y); label = memnew(Label); @@ -138,6 +140,7 @@ public: grid_step_x->set_allow_greater(true); grid_step_x->set_suffix("px"); grid_step_x->set_h_size_flags(Control::SIZE_EXPAND_FILL); + grid_step_x->set_select_all_on_focus(true); child_container->add_child(grid_step_x); grid_step_y = memnew(SpinBox); @@ -146,6 +149,7 @@ public: grid_step_y->set_allow_greater(true); grid_step_y->set_suffix("px"); grid_step_y->set_h_size_flags(Control::SIZE_EXPAND_FILL); + grid_step_y->set_select_all_on_focus(true); child_container->add_child(grid_step_y); child_container = memnew(GridContainer); @@ -164,6 +168,7 @@ public: primary_grid_steps->set_allow_greater(true); primary_grid_steps->set_suffix(TTR("steps")); primary_grid_steps->set_h_size_flags(Control::SIZE_EXPAND_FILL); + primary_grid_steps->set_select_all_on_focus(true); child_container->add_child(primary_grid_steps); container->add_child(memnew(HSeparator)); @@ -184,6 +189,7 @@ public: rotation_offset->set_max(SPIN_BOX_ROTATION_RANGE); rotation_offset->set_suffix("deg"); rotation_offset->set_h_size_flags(Control::SIZE_EXPAND_FILL); + rotation_offset->set_select_all_on_focus(true); child_container->add_child(rotation_offset); label = memnew(Label); @@ -196,6 +202,7 @@ public: rotation_step->set_max(SPIN_BOX_ROTATION_RANGE); rotation_step->set_suffix("deg"); rotation_step->set_h_size_flags(Control::SIZE_EXPAND_FILL); + rotation_step->set_select_all_on_focus(true); child_container->add_child(rotation_step); container->add_child(memnew(HSeparator)); @@ -214,6 +221,7 @@ public: scale_step->set_allow_greater(true); scale_step->set_h_size_flags(Control::SIZE_EXPAND_FILL); scale_step->set_step(0.01f); + scale_step->set_select_all_on_focus(true); child_container->add_child(scale_step); } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 40008b678a..2258646bce 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -8046,12 +8046,15 @@ Node3DEditor::Node3DEditor() { snap_dialog->add_child(snap_dialog_vbc); snap_translate = memnew(LineEdit); + snap_translate->set_select_all_on_focus(true); snap_dialog_vbc->add_margin_child(TTR("Translate Snap:"), snap_translate); snap_rotate = memnew(LineEdit); + snap_rotate->set_select_all_on_focus(true); snap_dialog_vbc->add_margin_child(TTR("Rotate Snap (deg.):"), snap_rotate); snap_scale = memnew(LineEdit); + snap_scale->set_select_all_on_focus(true); snap_dialog_vbc->add_margin_child(TTR("Scale Snap (%):"), snap_scale); _snap_update(); @@ -8070,6 +8073,7 @@ Node3DEditor::Node3DEditor() { settings_fov->set_min(MIN_FOV); settings_fov->set_step(0.1); settings_fov->set_value(EDITOR_GET("editors/3d/default_fov")); + settings_fov->set_select_all_on_focus(true); settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"), settings_fov); settings_znear = memnew(SpinBox); @@ -8077,6 +8081,7 @@ Node3DEditor::Node3DEditor() { settings_znear->set_min(MIN_Z); settings_znear->set_step(0.01); settings_znear->set_value(EDITOR_GET("editors/3d/default_z_near")); + settings_znear->set_select_all_on_focus(true); settings_vbc->add_margin_child(TTR("View Z-Near:"), settings_znear); settings_zfar = memnew(SpinBox); @@ -8084,6 +8089,7 @@ Node3DEditor::Node3DEditor() { settings_zfar->set_min(MIN_Z); settings_zfar->set_step(0.1); settings_zfar->set_value(EDITOR_GET("editors/3d/default_z_far")); + settings_zfar->set_select_all_on_focus(true); settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar); for (uint32_t i = 0; i < VIEWPORTS_COUNT; ++i) { @@ -8109,6 +8115,7 @@ Node3DEditor::Node3DEditor() { for (int i = 0; i < 3; i++) { xform_translate[i] = memnew(LineEdit); xform_translate[i]->set_h_size_flags(SIZE_EXPAND_FILL); + xform_translate[i]->set_select_all_on_focus(true); xform_hbc->add_child(xform_translate[i]); } @@ -8122,6 +8129,7 @@ Node3DEditor::Node3DEditor() { for (int i = 0; i < 3; i++) { xform_rotate[i] = memnew(LineEdit); xform_rotate[i]->set_h_size_flags(SIZE_EXPAND_FILL); + xform_rotate[i]->set_select_all_on_focus(true); xform_hbc->add_child(xform_rotate[i]); } @@ -8135,6 +8143,7 @@ Node3DEditor::Node3DEditor() { for (int i = 0; i < 3; i++) { xform_scale[i] = memnew(LineEdit); xform_scale[i]->set_h_size_flags(SIZE_EXPAND_FILL); + xform_scale[i]->set_select_all_on_focus(true); xform_hbc->add_child(xform_scale[i]); } |