Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] NodeEditor: Addressed Tab Retention when switching Node selection #2624

Merged
merged 5 commits into from
Dec 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions meshroom/ui/qml/GraphEditor/NodeEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ Panel {

property bool isComputable: root.node !== null && root.node.isComputable

// The indices of the tab bar which can be shown for incomputable nodes
readonly property var nonComputableTabIndices: [0, 4, 5];

Layout.fillWidth: true
width: childrenRect.width
position: TabBar.Footer
Expand Down Expand Up @@ -415,9 +418,11 @@ Panel {
rightPadding: leftPadding
}

onIsComputableChanged: {
if (!isComputable) {
tabBar.currentIndex = 0
onVisibleChanged: {
// If we have a node selected and the node is not Computable
// Reset the currentIndex to 0, if the current index is not allowed for an incomputable node
if ((root.node && !root.node.isComputable) && (nonComputableTabIndices.indexOf(tabBar.currentIndex) === -1)) {
tabBar.currentIndex = 0;
}
}
}
Expand Down
Loading