diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-05-25 10:46:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-25 10:46:03 +0200 |
commit | cc8023cd1eed56f5efdf7964d42cb4a5cb8b3345 (patch) | |
tree | d954a872b5623f6ae9130dfb42beb8813802a341 /editor/plugins | |
parent | 3f38a40a4dbc448a10823d784261064c764ff651 (diff) | |
parent | d29d85693384d8cf9ff88739c1ac4f4b7bd4b472 (diff) |
Merge pull request #29157 from YeldhamDev/spatial_view_button_container
Place the spatial editor's top left buttons in a container
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 95a70f2ae5..60f1248ace 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -3510,10 +3510,14 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed camera->make_current(); surface->set_focus_mode(FOCUS_ALL); + VBoxContainer *vbox = memnew(VBoxContainer); + surface->add_child(vbox); + vbox->set_position(Point2(10, 10) * EDSCALE); + view_menu = memnew(MenuButton); view_menu->set_flat(false); - surface->add_child(view_menu); - view_menu->set_position(Point2(10, 10) * EDSCALE); + vbox->add_child(view_menu); + view_menu->set_h_size_flags(0); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/top_view"), VIEW_TOP); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/bottom_view"), VIEW_BOTTOM); @@ -3566,9 +3570,9 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed ED_SHORTCUT("spatial_editor/freelook_speed_modifier", TTR("Freelook Speed Modifier"), KEY_SHIFT); preview_camera = memnew(CheckBox); - preview_camera->set_position(Point2(10, 38) * EDSCALE); // Below the 'view_menu' MenuButton. preview_camera->set_text(TTR("Preview")); - surface->add_child(preview_camera); + vbox->add_child(preview_camera); + preview_camera->set_h_size_flags(0); preview_camera->hide(); preview_camera->connect("toggled", this, "_toggle_camera_preview"); previewing = NULL; |