UI: Compositor: Show Parent button when available

The Parent Node Tree operator button to go up a level in nested
node trees is always visible in the header, regardless if we are
currently in a nested tree or not.

Only show the button when it is actually possible to go a level up.
This frees up space in the header when at the top level.
This commit is contained in:
Pablo Vazquez
2024-09-12 15:42:39 +02:00
parent 3986b99e42
commit 14208b6dfa

View File

@@ -197,7 +197,8 @@ class NODE_HT_header(Header):
if is_compositor:
layout.prop(snode, "pin", text="", emboss=False)
layout.operator("node.tree_path_parent", text="", icon='FILE_PARENT')
if len(snode.path) > 1:
layout.operator("node.tree_path_parent", text="", icon='FILE_PARENT')
# Backdrop
if is_compositor: