Skip to content

Commit c0c1c68

Browse files
committed
Merge pull request #111600 from KoBeWi/header_shoulders
Improve Transform dialog
2 parents 685fa32 + 88eef2a commit c0c1c68

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
@@ -9971,58 +9971,36 @@ Node3DEditor::Node3DEditor() {
99719971
VBoxContainer *xform_vbc = memnew(VBoxContainer);
99729972
xform_dialog->add_child(xform_vbc);
99739973

9974-
Label *l = memnew(Label);
9975-
l->set_text(TTRC("Translate:"));
9976-
xform_vbc->add_child(l);
9977-
9978-
HBoxContainer *xform_hbc = memnew(HBoxContainer);
9979-
xform_vbc->add_child(xform_hbc);
9974+
HBoxContainer *translate_hb = memnew(HBoxContainer);
9975+
xform_vbc->add_margin_child(TTRC("Translate:"), translate_hb);
9976+
HBoxContainer *rotate_hb = memnew(HBoxContainer);
9977+
xform_vbc->add_margin_child(TTRC("Rotate (deg.):"), rotate_hb);
9978+
HBoxContainer *scale_hb = memnew(HBoxContainer);
9979+
xform_vbc->add_margin_child(TTRC("Scale (ratio):"), scale_hb);
99809980

99819981
for (int i = 0; i < 3; i++) {
99829982
xform_translate[i] = memnew(LineEdit);
99839983
xform_translate[i]->set_h_size_flags(SIZE_EXPAND_FILL);
99849984
xform_translate[i]->set_select_all_on_focus(true);
9985-
xform_hbc->add_child(xform_translate[i]);
9986-
}
9987-
9988-
l = memnew(Label);
9989-
l->set_text(TTRC("Rotate (deg.):"));
9990-
xform_vbc->add_child(l);
9985+
translate_hb->add_child(xform_translate[i]);
99919986

9992-
xform_hbc = memnew(HBoxContainer);
9993-
xform_vbc->add_child(xform_hbc);
9994-
9995-
for (int i = 0; i < 3; i++) {
99969987
xform_rotate[i] = memnew(LineEdit);
99979988
xform_rotate[i]->set_h_size_flags(SIZE_EXPAND_FILL);
99989989
xform_rotate[i]->set_select_all_on_focus(true);
9999-
xform_hbc->add_child(xform_rotate[i]);
10000-
}
10001-
10002-
l = memnew(Label);
10003-
l->set_text(TTRC("Scale (ratio):"));
10004-
xform_vbc->add_child(l);
10005-
10006-
xform_hbc = memnew(HBoxContainer);
10007-
xform_vbc->add_child(xform_hbc);
9990+
rotate_hb->add_child(xform_rotate[i]);
100089991

10009-
for (int i = 0; i < 3; i++) {
100109992
xform_scale[i] = memnew(LineEdit);
100119993
xform_scale[i]->set_h_size_flags(SIZE_EXPAND_FILL);
100129994
xform_scale[i]->set_select_all_on_focus(true);
10013-
xform_hbc->add_child(xform_scale[i]);
9995+
scale_hb->add_child(xform_scale[i]);
100149996
}
100159997

10016-
l = memnew(Label);
10017-
l->set_text(TTRC("Transform Type"));
10018-
xform_vbc->add_child(l);
10019-
100209998
xform_type = memnew(OptionButton);
100219999
xform_type->set_h_size_flags(SIZE_EXPAND_FILL);
1002210000
xform_type->set_accessibility_name(TTRC("Transform Type"));
1002310001
xform_type->add_item(TTRC("Pre"));
1002410002
xform_type->add_item(TTRC("Post"));
10025-
xform_vbc->add_child(xform_type);
10003+
xform_vbc->add_margin_child(TTRC("Transform Type"), xform_type);
1002610004

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

0 commit comments

Comments
 (0)