diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-08 13:17:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 13:17:35 +0100 |
commit | 561fbe21751806ddec84311e4fed7943e241cd25 (patch) | |
tree | 03fe430735c45e9b7345184d8904b573b2414298 /editor/scene_tree_dock.cpp | |
parent | f9e496168f336b750149ad95a9eab526a0be0fcc (diff) | |
parent | f8dde5871c02bad4cb5c14b187a087cf8a82c534 (diff) |
Merge pull request #56923 from fire-forge/fix-create-root-node-scrolling
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r-- | editor/scene_tree_dock.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 9b18d3a491..0e362b13c6 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1206,8 +1206,16 @@ void SceneTreeDock::_notification(int p_what) { create_root_dialog->add_child(top_row); + ScrollContainer *scroll_container = memnew(ScrollContainer); + scroll_container->set_name("NodeShortcutsScrollContainer"); + create_root_dialog->add_child(scroll_container); + scroll_container->set_v_size_flags(SIZE_EXPAND_FILL); + scroll_container->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); + VBoxContainer *node_shortcuts = memnew(VBoxContainer); node_shortcuts->set_name("NodeShortcuts"); + scroll_container->add_child(node_shortcuts); + node_shortcuts->set_h_size_flags(SIZE_EXPAND_FILL); VBoxContainer *beginner_node_shortcuts = memnew(VBoxContainer); beginner_node_shortcuts->set_name("BeginnerNodeShortcuts"); @@ -1247,8 +1255,6 @@ void SceneTreeDock::_notification(int p_what) { button_clipboard->set_icon(get_theme_icon(SNAME("ActionPaste"), SNAME("EditorIcons"))); button_clipboard->connect("pressed", callable_bind(callable_mp(this, &SceneTreeDock::_tool_selected), TOOL_PASTE, false)); - node_shortcuts->add_spacer(); - create_root_dialog->add_child(node_shortcuts); _update_create_root_dialog(); } break; @@ -3112,7 +3118,7 @@ void SceneTreeDock::_local_tree_selected() { void SceneTreeDock::_update_create_root_dialog() { BaseButton *toggle = Object::cast_to<BaseButton>(create_root_dialog->get_node(String("NodeShortcutsTopRow/NodeShortcutsToggle"))); - Node *node_shortcuts = create_root_dialog->get_node(String("NodeShortcuts")); + Node *node_shortcuts = create_root_dialog->get_node(String("NodeShortcutsScrollContainer/NodeShortcuts")); if (!toggle || !node_shortcuts) { return; @@ -3142,6 +3148,7 @@ void SceneTreeDock::_update_create_root_dialog() { Button *button = memnew(Button); favorite_nodes->add_child(button); button->set_text(l); + button->set_clip_text(true); String name = l.get_slicec(' ', 0); if (ScriptServer::is_global_class(name)) { name = ScriptServer::get_global_class_native_base(name); @@ -3403,6 +3410,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel create_root_dialog = memnew(VBoxContainer); vbc->add_child(create_root_dialog); + create_root_dialog->set_v_size_flags(SIZE_EXPAND_FILL); create_root_dialog->hide(); scene_tree = memnew(SceneTreeEditor(false, true, true)); |