Merge pull request #57041 from fire-forge/fix-create-root-node-scrolling-3.x
This commit is contained in:
commit
7dc00ddae8
1 changed files with 11 additions and 3 deletions
|
@ -1265,8 +1265,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_enable_h_scroll(false);
|
||||
|
||||
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");
|
||||
|
@ -1299,8 +1307,6 @@ void SceneTreeDock::_notification(int p_what) {
|
|||
button_custom->set_icon(get_icon("Add", "EditorIcons"));
|
||||
button_custom->connect("pressed", this, "_tool_selected", make_binds(TOOL_NEW, false));
|
||||
|
||||
node_shortcuts->add_spacer();
|
||||
create_root_dialog->add_child(node_shortcuts);
|
||||
_update_create_root_dialog();
|
||||
} break;
|
||||
|
||||
|
@ -3011,7 +3017,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;
|
||||
|
@ -3041,6 +3047,7 @@ void SceneTreeDock::_update_create_root_dialog() {
|
|||
Button *button = memnew(Button);
|
||||
favorite_nodes->add_child(button);
|
||||
button->set_text(TTR(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);
|
||||
|
@ -3310,6 +3317,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));
|
||||
|
|
Loading…
Reference in a new issue