Skip to content

Commit dcfddd4

Browse files
committed
Merge pull request #109676 from bruvzg/menu_spacers
[macOS] Fix embedded menu/spacer relative position.
2 parents 925fd8a + ab0bc7e commit dcfddd4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

editor/editor_node.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7404,13 +7404,13 @@ void EditorNode::_update_main_menu_type() {
74047404
menu_btn_spacer = memnew(Control);
74057405
menu_btn_spacer->set_custom_minimum_size(Vector2(8, 0) * EDSCALE);
74067406
title_bar->add_child(menu_btn_spacer);
7407-
title_bar->move_child(menu_btn_spacer, 0);
7407+
title_bar->move_child(menu_btn_spacer, left_menu_spacer ? left_menu_spacer->get_index() + 1 : 0);
74087408
#endif
74097409
title_bar->add_child(main_menu_button);
74107410
if (menu_btn_spacer == nullptr) {
7411-
title_bar->move_child(main_menu_button, 0);
7411+
title_bar->move_child(main_menu_button, left_menu_spacer ? left_menu_spacer->get_index() + 1 : 0);
74127412
} else {
7413-
title_bar->move_child(main_menu_button, 1);
7413+
title_bar->move_child(main_menu_button, menu_btn_spacer->get_index() + 1);
74147414
}
74157415
memdelete_notnull(main_menu_bar);
74167416
main_menu_bar = nullptr;
@@ -7445,7 +7445,7 @@ void EditorNode::_update_main_menu_type() {
74457445
}
74467446

74477447
title_bar->add_child(main_menu_bar);
7448-
title_bar->move_child(main_menu_bar, 0);
7448+
title_bar->move_child(main_menu_bar, left_menu_spacer ? left_menu_spacer->get_index() + 1 : 0);
74497449

74507450
memdelete_notnull(menu_btn_spacer);
74517451
memdelete_notnull(main_menu_button);

0 commit comments

Comments
 (0)