From 4ca43028d8cd592522de5a15f6af3eb164ca7fae Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Fri, 17 Nov 2017 19:19:49 +0100 Subject: [PATCH] [ui] add 3D viewer to ImageGallery TODO: change Component's name --- meshroom/ui/qml/ImageGallery.qml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/meshroom/ui/qml/ImageGallery.qml b/meshroom/ui/qml/ImageGallery.qml index 4df12532..f5e3ff87 100644 --- a/meshroom/ui/qml/ImageGallery.qml +++ b/meshroom/ui/qml/ImageGallery.qml @@ -45,12 +45,13 @@ Item { fillMode: Image.PreserveAspectFit } Rectangle { - color: palette.midlight + color: Qt.darker(palette.base, 1.15) anchors.fill: parent - anchors.margins: 3 + anchors.margins: 4 border.color: palette.highlight border.width: imageMA.containsMouse || grid.currentIndex == index ? 2 : 0 z: -1 + MouseArea { id: imageMA anchors.fill: parent @@ -77,8 +78,30 @@ Item { Layout.minimumWidth: 40 Viewer2D { anchors.fill: parent - anchors.margins: 10 + anchors.margins: 4 source: grid.currentItem.source + Rectangle { + z: -1 + anchors.fill: parent + color: Qt.darker(palette.base, 1.1) + } + } + } + Item { + implicitWidth: Math.round(parent.width * 0.3) + Layout.minimumWidth: 20 + Platform.FileDialog { + id: modelDialog + nameFilters: ["3D Models (*.obj)"] + onAccepted: viewer3D.loadModel(file) + } + Viewer3D { + id: viewer3D + anchors.fill: parent + Button { + text: "Load Model" + onClicked: modelDialog.open() + } } } }