Skip to content

Commit 34920b4

Browse files
committed
Merge pull request godotengine#97747 from adamscott/ux-sun-angle
Improve UI of sun angle in the sun/preview env popup
2 parents 5ac62a6 + b380584 commit 34920b4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

editor/plugins/node_3d_editor_plugin.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9003,8 +9003,7 @@ Node3DEditor::Node3DEditor() {
90039003
current_hover_gizmo_handle = -1;
90049004
current_hover_gizmo_handle_secondary = false;
90059005
{
9006-
//sun popup
9007-
9006+
// Sun/preview environment popup.
90089007
sun_environ_popup = memnew(PopupPanel);
90099008
add_child(sun_environ_popup);
90109009

@@ -9018,7 +9017,7 @@ Node3DEditor::Node3DEditor() {
90189017
sun_vb->hide();
90199018

90209019
sun_title = memnew(Label);
9021-
sun_title->set_theme_type_variation("HeaderSmall");
9020+
sun_title->set_theme_type_variation("HeaderMedium");
90229021
sun_vb->add_child(sun_title);
90239022
sun_title->set_text(TTR("Preview Sun"));
90249023
sun_title->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
@@ -9056,23 +9055,28 @@ void fragment() {
90569055
sun_direction->set_material(sun_direction_material);
90579056

90589057
HBoxContainer *sun_angle_hbox = memnew(HBoxContainer);
9058+
sun_angle_hbox->set_h_size_flags(SIZE_EXPAND_FILL);
90599059
VBoxContainer *sun_angle_altitude_vbox = memnew(VBoxContainer);
9060+
sun_angle_altitude_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
90609061
Label *sun_angle_altitude_label = memnew(Label);
90619062
sun_angle_altitude_label->set_text(TTR("Angular Altitude"));
90629063
sun_angle_altitude_vbox->add_child(sun_angle_altitude_label);
90639064
sun_angle_altitude = memnew(EditorSpinSlider);
9065+
sun_angle_altitude->set_suffix(U"\u00B0");
90649066
sun_angle_altitude->set_max(90);
90659067
sun_angle_altitude->set_min(-90);
90669068
sun_angle_altitude->set_step(0.1);
90679069
sun_angle_altitude->connect(SceneStringName(value_changed), callable_mp(this, &Node3DEditor::_sun_direction_angle_set).unbind(1));
90689070
sun_angle_altitude_vbox->add_child(sun_angle_altitude);
90699071
sun_angle_hbox->add_child(sun_angle_altitude_vbox);
90709072
VBoxContainer *sun_angle_azimuth_vbox = memnew(VBoxContainer);
9073+
sun_angle_azimuth_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
90719074
sun_angle_azimuth_vbox->set_custom_minimum_size(Vector2(100, 0));
90729075
Label *sun_angle_azimuth_label = memnew(Label);
90739076
sun_angle_azimuth_label->set_text(TTR("Azimuth"));
90749077
sun_angle_azimuth_vbox->add_child(sun_angle_azimuth_label);
90759078
sun_angle_azimuth = memnew(EditorSpinSlider);
9079+
sun_angle_azimuth->set_suffix(U"\u00B0");
90769080
sun_angle_azimuth->set_max(180);
90779081
sun_angle_azimuth->set_min(-180);
90789082
sun_angle_azimuth->set_step(0.1);
@@ -9117,7 +9121,7 @@ void fragment() {
91179121
sun_state->set_h_size_flags(SIZE_EXPAND_FILL);
91189122

91199123
VSeparator *sc = memnew(VSeparator);
9120-
sc->set_custom_minimum_size(Size2(50 * EDSCALE, 0));
9124+
sc->set_custom_minimum_size(Size2(10 * EDSCALE, 0));
91219125
sc->set_v_size_flags(SIZE_EXPAND_FILL);
91229126
sun_environ_hb->add_child(sc);
91239127

@@ -9127,7 +9131,7 @@ void fragment() {
91279131
environ_vb->hide();
91289132

91299133
environ_title = memnew(Label);
9130-
environ_title->set_theme_type_variation("HeaderSmall");
9134+
environ_title->set_theme_type_variation("HeaderMedium");
91319135

91329136
environ_vb->add_child(environ_title);
91339137
environ_title->set_text(TTR("Preview Environment"));
@@ -9154,21 +9158,25 @@ void fragment() {
91549158

91559159
environ_ao_button = memnew(Button);
91569160
environ_ao_button->set_text(TTR("AO"));
9161+
environ_ao_button->set_h_size_flags(SIZE_EXPAND_FILL);
91579162
environ_ao_button->set_toggle_mode(true);
91589163
environ_ao_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
91599164
fx_vb->add_child(environ_ao_button);
91609165
environ_glow_button = memnew(Button);
91619166
environ_glow_button->set_text(TTR("Glow"));
9167+
environ_glow_button->set_h_size_flags(SIZE_EXPAND_FILL);
91629168
environ_glow_button->set_toggle_mode(true);
91639169
environ_glow_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
91649170
fx_vb->add_child(environ_glow_button);
91659171
environ_tonemap_button = memnew(Button);
91669172
environ_tonemap_button->set_text(TTR("Tonemap"));
9173+
environ_tonemap_button->set_h_size_flags(SIZE_EXPAND_FILL);
91679174
environ_tonemap_button->set_toggle_mode(true);
91689175
environ_tonemap_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
91699176
fx_vb->add_child(environ_tonemap_button);
91709177
environ_gi_button = memnew(Button);
91719178
environ_gi_button->set_text(TTR("GI"));
9179+
environ_gi_button->set_h_size_flags(SIZE_EXPAND_FILL);
91729180
environ_gi_button->set_toggle_mode(true);
91739181
environ_gi_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
91749182
fx_vb->add_child(environ_gi_button);

0 commit comments

Comments
 (0)