[ui] NodeEditor index tabBar updated for nonComputing nodes

This commit is contained in:
Aurore LAFAURIE 2024-04-11 15:13:48 +02:00 committed by Fabien Castan
parent 3a199d7973
commit 927f261a93

View file

@ -337,6 +337,8 @@ Panel {
id: tabBar
visible: root.node !== null
property bool isComputable: root.node !== null && root.node.isComputable
Layout.fillWidth: true
width: childrenRect.width
position: TabBar.Footer
@ -348,21 +350,21 @@ Panel {
rightPadding: leftPadding
}
TabButton {
visible: node != null && node.isComputable
visible: tabBar.isComputable
width: !visible ? 0 : tabBar.width / tabBar.count
text: "Log"
leftPadding: 8
rightPadding: leftPadding
}
TabButton {
visible: node != null && node.isComputable
visible: tabBar.isComputable
width: !visible ? 0 : tabBar.width / tabBar.count
text: "Statistics"
leftPadding: 8
rightPadding: leftPadding
}
TabButton {
visible: node != null && node.isComputable
visible: tabBar.isComputable
width: !visible ? 0 : tabBar.width / tabBar.count
text: "Status"
leftPadding: 8
@ -379,6 +381,12 @@ Panel {
leftPadding: 8
rightPadding: leftPadding
}
onIsComputableChanged: {
if (!isComputable) {
tabBar.currentIndex = 0
}
}
}
}
}