mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 02:08:25 +02:00
[ui] add "Controls" module to centralize common UI components
* add FloatingPane control + use it in Viewer3D
This commit is contained in:
parent
6ae591e981
commit
d4c0a4975a
3 changed files with 30 additions and 8 deletions
17
meshroom/ui/qml/Controls/FloatingPane.qml
Normal file
17
meshroom/ui/qml/Controls/FloatingPane.qml
Normal file
|
@ -0,0 +1,17 @@
|
|||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
/**
|
||||
* FloatingPane provides a Pane with a slightly transparent default background
|
||||
* using palette.base as color. Useful to create floating toolbar/overlays.
|
||||
*/
|
||||
Pane {
|
||||
id: root
|
||||
|
||||
property bool opaque: false
|
||||
|
||||
padding: 6
|
||||
anchors.margins: 2
|
||||
background: Rectangle { color: root.palette.base; opacity: opaque ? 1.0 : 0.7; radius: 1 }
|
||||
}
|
3
meshroom/ui/qml/Controls/qmldir
Normal file
3
meshroom/ui/qml/Controls/qmldir
Normal file
|
@ -0,0 +1,3 @@
|
|||
module Controls
|
||||
|
||||
FloatingPane 1.0 FloatingPane.qml
|
|
@ -5,8 +5,11 @@ import QtQuick.Scene3D 2.0
|
|||
import Qt3D.Core 2.1
|
||||
import Qt3D.Render 2.1
|
||||
import Qt3D.Input 2.1 as Qt3DInput // to avoid clash with Controls2 Action
|
||||
|
||||
import MaterialIcons 2.2
|
||||
|
||||
import Controls 1.0
|
||||
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
|
@ -349,8 +352,8 @@ FocusScope {
|
|||
//
|
||||
|
||||
// Rotation/Scale
|
||||
Pane {
|
||||
background: Rectangle { color: palette.base; opacity: 0.5; radius: 2 }
|
||||
FloatingPane {
|
||||
anchors { top: parent.top; left: parent.left }
|
||||
|
||||
GridLayout {
|
||||
id: controlsLayout
|
||||
|
@ -391,9 +394,8 @@ FocusScope {
|
|||
}
|
||||
|
||||
// Outliner
|
||||
Pane {
|
||||
anchors.right: parent.right
|
||||
background: Rectangle { color: palette.base; opacity: 0.5; radius: 2 }
|
||||
FloatingPane {
|
||||
anchors { top: parent.top; right: parent.right }
|
||||
|
||||
Column {
|
||||
Row {
|
||||
|
@ -430,9 +432,9 @@ FocusScope {
|
|||
}
|
||||
|
||||
// Render Mode
|
||||
Pane {
|
||||
anchors.bottom: parent.bottom
|
||||
background: Rectangle { color: palette.base; opacity: 0.5; radius: 2 }
|
||||
FloatingPane {
|
||||
anchors { bottom: parent.bottom; left: parent.left }
|
||||
|
||||
|
||||
Row {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue