Merge pull request #2646 from alicevision/dev/AutoLayoutMenu

[ui] Moved Auto-Layout Depth Settings under Graph Editor Menu
This commit is contained in:
Candice Bentéjac 2025-01-17 14:42:54 +00:00 committed by GitHub
commit 6071a914bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 39 additions and 35 deletions

View file

@ -1159,6 +1159,45 @@ Page {
onTriggered: _reconstruction.graph.forceUnlockNodes()
}
Menu {
title: "Auto Layout Depth"
MenuItem {
id: autoLayoutMinimum
text: "Minimum"
checkable: true
checked: _reconstruction.layout.depthMode === 0
ToolTip.text: "Sets the Auto Layout Depth Mode to use Node's Minimum depth"
ToolTip.visible: hovered
ToolTip.delay: 200
onToggled: {
if (checked) {
_reconstruction.layout.depthMode = 0;
autoLayoutMaximum.checked = false;
}
// Prevents cases where the user unchecks the currently checked option
autoLayoutMinimum.checked = true;
}
}
MenuItem {
id: autoLayoutMaximum
text: "Maximum"
checkable: true
checked: _reconstruction.layout.depthMode === 1
ToolTip.text: "Sets the Auto Layout Depth Mode to use Node's Maximum depth"
ToolTip.visible: hovered
ToolTip.delay: 200
onToggled: {
if (checked) {
_reconstruction.layout.depthMode = 1;
autoLayoutMinimum.checked = false;
}
// Prevents cases where the user unchecks the currently checked option
autoLayoutMaximum.checked = true;
}
}
}
Menu {
title: "Refresh Nodes Method"

View file

@ -1058,41 +1058,6 @@ Item {
onClicked: uigraph.layout.reset()
}
// Separator
Rectangle {
Layout.fillHeight: true
Layout.margins: 2
implicitWidth: 1
color: activePalette.window
}
// Settings
MaterialToolButton {
text: MaterialIcons.settings
font.pointSize: 11
onClicked: menu.open()
Menu {
id: menu
y: -height
padding: 4
RowLayout {
spacing: 2
Label {
padding: 2
text: "Auto-Layout Depth:"
}
ComboBox {
flat: true
model: ['Minimum', 'Maximum']
implicitWidth: 85
currentIndex: uigraph ? uigraph.layout.depthMode : -1
onActivated: {
uigraph.layout.depthMode = currentIndex
}
}
}
}
}
// Separator
Rectangle {
Layout.fillHeight: true