diff --git a/meshroom/ui/qml/Application.qml b/meshroom/ui/qml/Application.qml index 3fb87e3b..2106ce27 100644 --- a/meshroom/ui/qml/Application.qml +++ b/meshroom/ui/qml/Application.qml @@ -1,6 +1,5 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as Controls1 // For SplitView import QtQuick.Layouts 1.11 import QtQuick.Window 2.15 import QtQml.Models 2.15 @@ -976,33 +975,32 @@ Page { function onError() { createDialog(dialogsFactory.error, arguments[0]) } } - Controls1.SplitView { + ColumnLayout { anchors.fill: parent - orientation: Qt.Vertical + spacing: 4 - // Setup global tooltip style - ToolTip.toolTip.background: Rectangle { color: activePalette.base; border.color: activePalette.mid } + // "ProgressBar" reflecting status of all the chunks in the graph, in their process order + NodeChunks { + id: chunksListView + height: 6 + width: parent.width + model: _reconstruction ? _reconstruction.sortedDFSChunks : null + highlightChunks: false + } - ColumnLayout { - Layout.fillWidth: true + SplitView { Layout.fillHeight: true - implicitHeight: Math.round(parent.height * 0.7) - spacing: 4 + width: parent.width - // "ProgressBar" reflecting status of all the chunks in the graph, in their process order - NodeChunks { - id: chunksListView - Layout.fillWidth: true - height: 6 - model: _reconstruction ? _reconstruction.sortedDFSChunks : null - highlightChunks: false - } + orientation: Qt.Vertical + + // Setup global tooltip style + ToolTip.toolTip.background: Rectangle { color: activePalette.base; border.color: activePalette.mid } WorkspaceView { id: workspaceView - Layout.fillWidth: true Layout.fillHeight: true - Layout.minimumHeight: 50 + SplitView.preferredHeight: 0.7 * parent.height reconstruction: _reconstruction readOnly: _reconstruction ? _reconstruction.computing : false @@ -1018,7 +1016,7 @@ Page { if (attr.isOutput && attr.desc.semantic !== "image") if (!alreadyDisplay || attr.desc.semantic == "3D") if (workspaceView.viewIn3D(attr, mouse)) - alreadyDisplay = true + alreadyDisplay = true } } @@ -1033,184 +1031,183 @@ Page { return loaded } } - } - Controls1.SplitView { - orientation: Qt.Horizontal - width: parent.width - property bool isOnlyGraphEditorVisible: settingsUILayout.showGraphEditor && !settingsUILayout.showImageViewer && !settingsUILayout.showViewer3D && !settingsUILayout.showImageGallery - height: isOnlyGraphEditorVisible ? parent.height : Math.round(parent.height * 0.3) - visible: settingsUILayout.showGraphEditor + SplitView { + id: bottomContainer + orientation: Qt.Horizontal + visible: settingsUILayout.showGraphEditor + SplitView.preferredHeight: 0.3 * parent.height - TabPanel { - id: graphEditorPanel - Layout.fillWidth: true - padding: 4 - tabs: ["Graph Editor", "Task Manager", "Script Editor"] + TabPanel { + id: graphEditorPanel + Layout.fillWidth: true + SplitView.preferredWidth: 0.7 * parent.width - headerBar: RowLayout { - MaterialToolButton { - text: MaterialIcons.sync - ToolTip.text: "Refresh Nodes Status" - ToolTip.visible: hovered - font.pointSize: 11 - padding: 2 - onClicked: { - updatingStatus = true - _reconstruction.forceNodesStatusUpdate() - updatingStatus = false + padding: 4 + tabs: ["Graph Editor", "Task Manager", "Script Editor"] + + headerBar: RowLayout { + MaterialToolButton { + text: MaterialIcons.sync + ToolTip.text: "Refresh Nodes Status" + ToolTip.visible: hovered + font.pointSize: 11 + padding: 2 + onClicked: { + updatingStatus = true + _reconstruction.forceNodesStatusUpdate() + updatingStatus = false + } + property bool updatingStatus: false + enabled: !updatingStatus } - property bool updatingStatus: false - enabled: !updatingStatus - } - MaterialToolButton { - text: MaterialIcons.more_vert - font.pointSize: 11 - padding: 2 - onClicked: graphEditorMenu.open() - checkable: true - checked: graphEditorMenu.visible - Menu { - id: graphEditorMenu - y: parent.height - x: -width + parent.width - MenuItem { - text: "Clear Pending Status" - enabled: _reconstruction ? !_reconstruction.computingLocally : false - onTriggered: _reconstruction.graph.clearSubmittedNodes() - } - MenuItem { - text: "Force Unlock Nodes" - onTriggered: _reconstruction.graph.forceUnlockNodes() - } - + MaterialToolButton { + text: MaterialIcons.more_vert + font.pointSize: 11 + padding: 2 + onClicked: graphEditorMenu.open() + checkable: true + checked: graphEditorMenu.visible Menu { - title: "Refresh Nodes Status" - + id: graphEditorMenu + y: parent.height + x: -width + parent.width MenuItem { - id: enableAutoRefresh - text: "Enable Auto-Refresh" - checkable: true - checked: _reconstruction.filePollerRefresh === 0 - ToolTip.text: "Check every file's status periodically" - ToolTip.visible: hovered - ToolTip.delay: 200 - onToggled: { - if (checked) { - disableAutoRefresh.checked = false - minimalAutoRefresh.checked = false - _reconstruction.filePollerRefreshChanged(0) - } - // Prevents cases where the user unchecks the currently checked option - enableAutoRefresh.checked = true + text: "Clear Pending Status" + enabled: _reconstruction ? !_reconstruction.computingLocally : false + onTriggered: _reconstruction.graph.clearSubmittedNodes() } - } - MenuItem { - id: disableAutoRefresh - text: "Disable Auto-Refresh" - checkable: true - checked: _reconstruction.filePollerRefresh === 1 - ToolTip.text: "No file status will be checked" - ToolTip.visible: hovered - ToolTip.delay: 200 - onToggled: { - if (checked) { - enableAutoRefresh.checked = false - minimalAutoRefresh.checked = false - _reconstruction.filePollerRefreshChanged(1) - } - // Prevents cases where the user unchecks the currently checked option - disableAutoRefresh.checked = true + MenuItem { + text: "Force Unlock Nodes" + onTriggered: _reconstruction.graph.forceUnlockNodes() } - } - MenuItem { - id: minimalAutoRefresh - text: "Enable Minimal Auto-Refresh" - checkable: true - checked: _reconstruction.filePollerRefresh === 2 - ToolTip.text: "Check the file status of submitted or running chunks periodically" - ToolTip.visible: hovered - ToolTip.delay: 200 - onToggled: { - if (checked) { - disableAutoRefresh.checked = false - enableAutoRefresh.checked = false - _reconstruction.filePollerRefreshChanged(2) + + Menu { + title: "Refresh Nodes Status" + + MenuItem { + id: enableAutoRefresh + text: "Enable Auto-Refresh" + checkable: true + checked: _reconstruction.filePollerRefresh === 0 + ToolTip.text: "Check every file's status periodically" + ToolTip.visible: hovered + ToolTip.delay: 200 + onToggled: { + if (checked) { + disableAutoRefresh.checked = false + minimalAutoRefresh.checked = false + _reconstruction.filePollerRefreshChanged(0) + } + // Prevents cases where the user unchecks the currently checked option + enableAutoRefresh.checked = true } - // Prevents cases where the user unchecks the currently checked option - minimalAutoRefresh.checked = true } - } + MenuItem { + id: disableAutoRefresh + text: "Disable Auto-Refresh" + checkable: true + checked: _reconstruction.filePollerRefresh === 1 + ToolTip.text: "No file status will be checked" + ToolTip.visible: hovered + ToolTip.delay: 200 + onToggled: { + if (checked) { + enableAutoRefresh.checked = false + minimalAutoRefresh.checked = false + _reconstruction.filePollerRefreshChanged(1) + } + // Prevents cases where the user unchecks the currently checked option + disableAutoRefresh.checked = true + } + } + MenuItem { + id: minimalAutoRefresh + text: "Enable Minimal Auto-Refresh" + checkable: true + checked: _reconstruction.filePollerRefresh === 2 + ToolTip.text: "Check the file status of submitted or running chunks periodically" + ToolTip.visible: hovered + ToolTip.delay: 200 + onToggled: { + if (checked) { + disableAutoRefresh.checked = false + enableAutoRefresh.checked = false + _reconstruction.filePollerRefreshChanged(2) + } + // Prevents cases where the user unchecks the currently checked option + minimalAutoRefresh.checked = true + } + } + } } } } - } - GraphEditor { - id: graphEditor + GraphEditor { + id: graphEditor + anchors.fill: parent - visible: graphEditorPanel.currentTab === 0 + visible: graphEditorPanel.currentTab === 0 - anchors.fill: parent - uigraph: _reconstruction - nodeTypesModel: _nodeTypes + uigraph: _reconstruction + nodeTypesModel: _nodeTypes - onNodeDoubleClicked: { - _reconstruction.setActiveNode(node); - workspaceView.viewNode(node, mouse); - } - onComputeRequest: { - _reconstruction.forceNodesStatusUpdate(); - computeManager.compute(nodes) - } - onSubmitRequest: { - _reconstruction.forceNodesStatusUpdate(); - computeManager.submit(nodes) - } - onFilesDropped: { - var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls) - if (filesByType["meshroomScenes"].length == 1) { - ensureSaved(function() { - if (_reconstruction.handleFilesUrl(filesByType, null, mousePosition)) { - MeshroomApp.addRecentProjectFile(filesByType["meshroomScenes"][0]) - } - }) - } else { - _reconstruction.handleFilesUrl(filesByType, null, mousePosition) + onNodeDoubleClicked: { + _reconstruction.setActiveNode(node); + workspaceView.viewNode(node, mouse); + } + onComputeRequest: { + _reconstruction.forceNodesStatusUpdate(); + computeManager.compute(nodes) + } + onSubmitRequest: { + _reconstruction.forceNodesStatusUpdate(); + computeManager.submit(nodes) + } + onFilesDropped: { + var filesByType = _reconstruction.getFilesByTypeFromDrop(drop.urls) + if (filesByType["meshroomScenes"].length == 1) { + ensureSaved(function() { + if (_reconstruction.handleFilesUrl(filesByType, null, mousePosition)) { + MeshroomApp.addRecentProjectFile(filesByType["meshroomScenes"][0]) + } + }) + } else { + _reconstruction.handleFilesUrl(filesByType, null, mousePosition) + } } } + + TaskManager { + id: taskManager + anchors.fill: parent + + visible: graphEditorPanel.currentTab === 1 + + uigraph: _reconstruction + taskManager: _reconstruction ? _reconstruction.taskManager : null + } + + ScriptEditor { + id: scriptEditor + anchors.fill: parent + + visible: graphEditorPanel.currentTab === 2 + } } - TaskManager { - id: taskManager + NodeEditor { + id: nodeEditor + node: _reconstruction ? _reconstruction.selectedNode : null + property bool computing: _reconstruction ? _reconstruction.computing : false + // Make NodeEditor readOnly when computing + readOnly: node ? node.locked : false - visible: graphEditorPanel.currentTab === 1 - - uigraph: _reconstruction - taskManager: _reconstruction ? _reconstruction.taskManager : null - - anchors.fill: parent - } - - ScriptEditor { - id: scriptEditor - - visible: graphEditorPanel.currentTab === 2 - anchors.fill: parent - } - } - - NodeEditor { - id: nodeEditor - width: Math.round(parent.width * 0.3) - node: _reconstruction ? _reconstruction.selectedNode : null - property bool computing: _reconstruction ? _reconstruction.computing : false - // Make NodeEditor readOnly when computing - readOnly: node ? node.locked : false - - onUpgradeRequest: { - var n = _reconstruction.upgradeNode(node) - _reconstruction.selectedNode = n + onUpgradeRequest: { + var n = _reconstruction.upgradeNode(node) + _reconstruction.selectedNode = n + } } } } diff --git a/meshroom/ui/qml/GraphEditor/ChunksListView.qml b/meshroom/ui/qml/GraphEditor/ChunksListView.qml index c8fd39cb..aadcb383 100644 --- a/meshroom/ui/qml/GraphEditor/ChunksListView.qml +++ b/meshroom/ui/qml/GraphEditor/ChunksListView.qml @@ -1,6 +1,5 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as Controls1 // SplitView import QtQuick.Layouts 1.11 import MaterialIcons 2.2 import Controls 1.0 diff --git a/meshroom/ui/qml/GraphEditor/NodeChunks.qml b/meshroom/ui/qml/GraphEditor/NodeChunks.qml index 672b51c0..a87d1c3c 100644 --- a/meshroom/ui/qml/GraphEditor/NodeChunks.qml +++ b/meshroom/ui/qml/GraphEditor/NodeChunks.qml @@ -20,7 +20,7 @@ ListView { } orientation: ListView.Horizontal - implicitWidth: 100 + // If we have enough space, add one pixel margin between chunks spacing: modelIsBig ? 0 : 1 delegate: Rectangle { diff --git a/meshroom/ui/qml/GraphEditor/NodeEditor.qml b/meshroom/ui/qml/GraphEditor/NodeEditor.qml index 3d468422..3cf95f18 100644 --- a/meshroom/ui/qml/GraphEditor/NodeEditor.qml +++ b/meshroom/ui/qml/GraphEditor/NodeEditor.qml @@ -1,6 +1,5 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as Controls1 // SplitView import QtQuick.Layouts 1.11 import MaterialIcons 2.2 import Controls 1.0 @@ -254,7 +253,7 @@ Panel { Component { id: editor_component - Controls1.SplitView { + SplitView { anchors.fill: parent // The list of chunks diff --git a/meshroom/ui/qml/GraphEditor/NodeStatistics.qml b/meshroom/ui/qml/GraphEditor/NodeStatistics.qml index f0c5b388..34a43ba0 100644 --- a/meshroom/ui/qml/GraphEditor/NodeStatistics.qml +++ b/meshroom/ui/qml/GraphEditor/NodeStatistics.qml @@ -1,6 +1,5 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as Controls1 // SplitView import QtQuick.Layouts 1.11 import MaterialIcons 2.2 import Controls 1.0 diff --git a/meshroom/ui/qml/Homepage.qml b/meshroom/ui/qml/Homepage.qml index fcccb2ac..329654ef 100644 --- a/meshroom/ui/qml/Homepage.qml +++ b/meshroom/ui/qml/Homepage.qml @@ -1,6 +1,5 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as Controls1 // For SplitView import QtQuick.Layouts 1.11 import Utils 1.0 import MaterialIcons 2.2 @@ -16,7 +15,7 @@ Page { } } - Controls1.SplitView { + SplitView { id: splitView anchors.fill: parent @@ -25,8 +24,8 @@ Page { id: leftColumn height: parent.height - Layout.minimumWidth: 200 - Layout.maximumWidth: 300 + SplitView.minimumWidth: 200 + SplitView.maximumWidth: 300 AnimatedImage { id: logo diff --git a/meshroom/ui/qml/Viewer3D/Viewer3D.qml b/meshroom/ui/qml/Viewer3D/Viewer3D.qml index 76ba1108..82c917c4 100644 --- a/meshroom/ui/qml/Viewer3D/Viewer3D.qml +++ b/meshroom/ui/qml/Viewer3D/Viewer3D.qml @@ -1,6 +1,5 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as Controls1 import QtQuick.Layouts 1.11 import QtQml.Models 2.15 import QtQuick.Scene3D 2.15 diff --git a/meshroom/ui/qml/WorkspaceView.qml b/meshroom/ui/qml/WorkspaceView.qml index fb0b6bb4..ed386766 100644 --- a/meshroom/ui/qml/WorkspaceView.qml +++ b/meshroom/ui/qml/WorkspaceView.qml @@ -1,6 +1,5 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as Controls1 // For SplitView import QtQuick.Layouts 1.11 import Qt.labs.platform 1.0 as Platform import ImageGallery 1.0 @@ -26,11 +25,9 @@ Item { readonly property Viewer2D viewer2D: viewer2D readonly property alias imageGallery: imageGallery - implicitWidth: 300 - implicitHeight: 400 + // Use settings instead of visible property as property changes are not propagated visible: settingsUILayout.showImageGallery || settingsUILayout.showImageViewer || settingsUILayout.showViewer3D || settingsUILayout.showLiveReconstruction - // Load a 3D media file in the 3D viewer function load3DMedia(filepath, label = undefined) { if (panel3dViewerLoader.active) { @@ -62,10 +59,12 @@ Item { SystemPalette { id: activePalette } - Controls1.SplitView { + SplitView { + id: mainSplitView anchors.fill: parent - Controls1.SplitView { + SplitView { + id: leftSplitView visible: settingsUILayout.showImageGallery || settingsUILayout.showLiveReconstruction orientation: Qt.Vertical Layout.fillHeight: true @@ -96,6 +95,7 @@ Item { } } LiveSfmView { + id: liveSfmView visible: settingsUILayout.showLiveReconstruction reconstruction: root.reconstruction Layout.fillWidth: true @@ -104,6 +104,7 @@ Item { } Panel { + id: imageViewer title: "Image Viewer" visible: settingsUILayout.showImageViewer implicitWidth: Math.round(parent.width * 0.35) @@ -190,6 +191,7 @@ Item { } Item { + id: viewer3DContainer visible: settingsUILayout.showViewer3D Layout.minimumWidth: 20 Layout.minimumHeight: 80 @@ -213,15 +215,15 @@ Item { property alias viewer3D: c_viewer3D - Controls1.SplitView { + SplitView { id: c_viewer3DSplitView anchors.fill: parent Viewer3D { id: c_viewer3D - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: 20 + SplitView.fillWidth: true + SplitView.fillHeight: true + SplitView.minimumWidth: 20 DropArea { anchors.fill: parent