Skip to content

Commit 88eef2a

Browse files
committed
Improve Transform dialog
1 parent 4219ce9 commit 88eef2a

File tree

1 file changed

+10
-32
lines changed

1 file changed

+10
-32
lines changed

editor/scene/3d/node_3d_editor_plugin.cpp

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9838,58 +9838,36 @@ Node3DEditor::Node3DEditor() {
98389838
VBoxContainer *xform_vbc = memnew(VBoxContainer);
98399839
xform_dialog->add_child(xform_vbc);
98409840

9841-
Label *l = memnew(Label);
9842-
l->set_text(TTRC("Translate:"));
9843-
xform_vbc->add_child(l);
9844-
9845-
HBoxContainer *xform_hbc = memnew(HBoxContainer);
9846-
xform_vbc->add_child(xform_hbc);
9841+
HBoxContainer *translate_hb = memnew(HBoxContainer);
9842+
xform_vbc->add_margin_child(TTRC("Translate:"), translate_hb);
9843+
HBoxContainer *rotate_hb = memnew(HBoxContainer);
9844+
xform_vbc->add_margin_child(TTRC("Rotate (deg.):"), rotate_hb);
9845+
HBoxContainer *scale_hb = memnew(HBoxContainer);
9846+
xform_vbc->add_margin_child(TTRC("Scale (ratio):"), scale_hb);
98479847

98489848
for (int i = 0; i < 3; i++) {
98499849
xform_translate[i] = memnew(LineEdit);
98509850
xform_translate[i]->set_h_size_flags(SIZE_EXPAND_FILL);
98519851
xform_translate[i]->set_select_all_on_focus(true);
9852-
xform_hbc->add_child(xform_translate[i]);
9853-
}
9854-
9855-
l = memnew(Label);
9856-
l->set_text(TTRC("Rotate (deg.):"));
9857-
xform_vbc->add_child(l);
9852+
translate_hb->add_child(xform_translate[i]);
98589853

9859-
xform_hbc = memnew(HBoxContainer);
9860-
xform_vbc->add_child(xform_hbc);
9861-
9862-
for (int i = 0; i < 3; i++) {
98639854
xform_rotate[i] = memnew(LineEdit);
98649855
xform_rotate[i]->set_h_size_flags(SIZE_EXPAND_FILL);
98659856
xform_rotate[i]->set_select_all_on_focus(true);
9866-
xform_hbc->add_child(xform_rotate[i]);
9867-
}
9868-
9869-
l = memnew(Label);
9870-
l->set_text(TTRC("Scale (ratio):"));
9871-
xform_vbc->add_child(l);
9872-
9873-
xform_hbc = memnew(HBoxContainer);
9874-
xform_vbc->add_child(xform_hbc);
9857+
rotate_hb->add_child(xform_rotate[i]);
98759858

9876-
for (int i = 0; i < 3; i++) {
98779859
xform_scale[i] = memnew(LineEdit);
98789860
xform_scale[i]->set_h_size_flags(SIZE_EXPAND_FILL);
98799861
xform_scale[i]->set_select_all_on_focus(true);
9880-
xform_hbc->add_child(xform_scale[i]);
9862+
scale_hb->add_child(xform_scale[i]);
98819863
}
98829864

9883-
l = memnew(Label);
9884-
l->set_text(TTRC("Transform Type"));
9885-
xform_vbc->add_child(l);
9886-
98879865
xform_type = memnew(OptionButton);
98889866
xform_type->set_h_size_flags(SIZE_EXPAND_FILL);
98899867
xform_type->set_accessibility_name(TTRC("Transform Type"));
98909868
xform_type->add_item(TTRC("Pre"));
98919869
xform_type->add_item(TTRC("Post"));
9892-
xform_vbc->add_child(xform_type);
9870+
xform_vbc->add_margin_child(TTRC("Transform Type"), xform_type);
98939871

98949872
xform_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Node3DEditor::_xform_dialog_action));
98959873

0 commit comments

Comments
 (0)