summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-18 11:25:45 +0100
committerGitHub <noreply@github.com>2022-03-18 11:25:45 +0100
commitd9382b22166018d9993bf7548356a2d658604510 (patch)
treeb6a4e0946cd1ab97418ccc513dd1c43e7f49f696
parentcb0d575fd017c2b537997158d6e8583e36e1059a (diff)
parent46ca4737f19f3701ec352f2e898514109c096587 (diff)
Merge pull request #59269 from Vitika9/59196
-rw-r--r--editor/scene_tree_dock.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 8d7916685a..13ece9011b 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -2735,7 +2735,10 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
}
if (profile_allow_editing) {
+ bool add_separator = false;
+
if (full_selection.size() == 1) {
+ add_separator = true;
menu->add_icon_shortcut(get_theme_icon(SNAME("Rename"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/rename"), TOOL_RENAME);
}
@@ -2748,11 +2751,14 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
}
if (can_replace) {
+ add_separator = true;
menu->add_icon_shortcut(get_theme_icon(SNAME("Reload"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/change_node_type"), TOOL_REPLACE);
}
if (scene_tree->get_selected() != edited_scene) {
- menu->add_separator();
+ if (add_separator) {
+ menu->add_separator();
+ }
menu->add_icon_shortcut(get_theme_icon(SNAME("MoveUp"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/move_up"), TOOL_MOVE_UP);
menu->add_icon_shortcut(get_theme_icon(SNAME("MoveDown"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/move_down"), TOOL_MOVE_DOWN);
menu->add_icon_shortcut(get_theme_icon(SNAME("Duplicate"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/duplicate"), TOOL_DUPLICATE);