diff --git a/meshroom/ui/qml/GraphEditor/GraphEditor.qml b/meshroom/ui/qml/GraphEditor/GraphEditor.qml index 5a8ab1b3..69703777 100755 --- a/meshroom/ui/qml/GraphEditor/GraphEditor.qml +++ b/meshroom/ui/qml/GraphEditor/GraphEditor.qml @@ -21,6 +21,16 @@ Item { signal workspaceClicked() signal nodeDoubleClicked(var node) + // trigger initial fit() after initialization + // (ensure GraphEditor has its final size) + Component.onCompleted: firstFitTimer.start() + + Timer { + id: firstFitTimer + running: false + interval: 10 + onTriggered: fit() + } clip: true @@ -49,6 +59,12 @@ Item { selectNode(nodes[0]) } + + Keys.onPressed: { + if(event.key === Qt.Key_F) + fit() + } + MouseArea { id: mouseArea anchors.fill: parent diff --git a/meshroom/ui/qml/main.qml b/meshroom/ui/qml/main.qml index 8fd63df2..2a28c4cb 100755 --- a/meshroom/ui/qml/main.qml +++ b/meshroom/ui/qml/main.qml @@ -322,6 +322,8 @@ ApplicationWindow { // open CompatibilityManager after file loading if any issue is detected if(compatibilityManager.issueCount) compatibilityManager.open() + // trigger fit to visualize all nodes + graphEditor.fit() } onInfo: createDialog(dialogsFactory.info, arguments[0])