From 94cba653d55ce7acd54be30a18800c106eda5c27 Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Fri, 27 Jul 2018 18:28:49 +0200 Subject: [PATCH] [ui] GraphEditor: improved ToolBar * replace text buttons with MaterialToolButtons * hide advanced min/max depth settings to a Settings menu --- meshroom/ui/qml/GraphEditor/GraphEditor.qml | 69 ++++++++++++++++----- meshroom/ui/qml/main.qml | 5 +- 2 files changed, 56 insertions(+), 18 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/GraphEditor.qml b/meshroom/ui/qml/GraphEditor/GraphEditor.qml index 019b902c..4fbcf4f0 100755 --- a/meshroom/ui/qml/GraphEditor/GraphEditor.qml +++ b/meshroom/ui/qml/GraphEditor/GraphEditor.qml @@ -1,6 +1,8 @@ import QtQuick 2.7 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 +import Controls 1.0 +import MaterialIcons 2.2 /** A component displaying a Graph (nodes, attributes and edges). @@ -345,25 +347,58 @@ Item { } } - Row { + // Toolbar + FloatingPane { + padding: 2 anchors.bottom: parent.bottom + RowLayout { + spacing: 4 + // Fit + MaterialToolButton { + text: MaterialIcons.fullscreen + ToolTip.text: "Fit" + onClicked: root.fit() + } + // Auto-Layout + MaterialToolButton { + text: MaterialIcons.linear_scale + ToolTip.text: "Auto-Layout" + onClicked: uigraph.layout.reset() + } - Button { - text: "Fit" - onClicked: root.fit() - z: 10 - } - - Button { - text: "Layout" - onClicked: uigraph.layout.reset() - z: 10 - } - ComboBox { - model: ['Min Depth', 'Max Depth'] - currentIndex: uigraph.layout.depthMode - onActivated: { - uigraph.layout.depthMode = currentIndex + // 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: 80 + currentIndex: uigraph.layout.depthMode + onActivated: { + uigraph.layout.depthMode = currentIndex + } + } + } + } } } } diff --git a/meshroom/ui/qml/main.qml b/meshroom/ui/qml/main.qml index 2a28c4cb..7da9a10e 100755 --- a/meshroom/ui/qml/main.qml +++ b/meshroom/ui/qml/main.qml @@ -440,13 +440,16 @@ ApplicationWindow { Item { Layout.fillHeight: true Layout.fillWidth: true - Layout.margins: 10 + Layout.margins: 2 + GraphEditor { id: graphEditor + anchors.fill: parent uigraph: _reconstruction nodeTypesModel: _nodeTypes readOnly: _reconstruction.computing + onNodeDoubleClicked: { if(node.nodeType == "StructureFromMotion") {