mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-13 14:57:22 +02:00
[ui] Change Intrinsic display QML structure
This commit is contained in:
parent
7a8f78f5e1
commit
2eb8783c95
1 changed files with 54 additions and 29 deletions
|
@ -12,15 +12,38 @@ RowLayout {
|
||||||
property variant attribute: model.display
|
property variant attribute: model.display
|
||||||
property int rowIndex: model.row
|
property int rowIndex: model.row
|
||||||
property bool readOnly: false
|
property bool readOnly: false
|
||||||
|
property string toolTipText: attribute.fullLabel
|
||||||
|
|
||||||
|
Pane {
|
||||||
|
// anchors.fill: parent
|
||||||
|
// Layout: childrenRect.width
|
||||||
|
Layout.minimumWidth: loaderComponent.width
|
||||||
|
Layout.minimumHeight: loaderComponent.height
|
||||||
|
Layout.fillWidth: true
|
||||||
|
// color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
||||||
|
// z: -1
|
||||||
|
// border.width: 2
|
||||||
|
// border.color: Qt.darker(palette.window, 1.1)
|
||||||
|
padding: 0
|
||||||
|
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
ToolTip.delay: 10
|
||||||
|
ToolTip.timeout: 5000
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
ToolTip.text: toolTipText
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: loaderComponent.height
|
||||||
|
|
||||||
|
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
||||||
|
border.width: 2
|
||||||
|
border.color: Qt.darker(palette.window, 1.1)
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
Layout.fillWidth: true
|
id: loaderComponent
|
||||||
|
|
||||||
sourceComponent: {
|
sourceComponent: {
|
||||||
//console.warn("keys " + Object.keys(intrinsicModel.columns[model.index]))
|
|
||||||
//console.warn("index " + intrinsicModel.columnCount)
|
|
||||||
//console.warn("HEEELPPP " + model.display.desc.values)
|
|
||||||
//console.warn("Object " + intrinsicModel.columns[model.index].display)
|
|
||||||
switch(model.display.type)
|
switch(model.display.type)
|
||||||
{
|
{
|
||||||
case "ChoiceParam": return choice_component
|
case "ChoiceParam": return choice_component
|
||||||
|
@ -32,6 +55,8 @@ RowLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: textField_component
|
id: textField_component
|
||||||
|
@ -42,15 +67,14 @@ RowLayout {
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
selectionColor: 'white'
|
selectionColor: 'white'
|
||||||
selectedTextColor: Qt.darker(palette.window, 1.1)
|
selectedTextColor: Qt.darker(palette.window, 1.1)
|
||||||
|
/*
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
||||||
z: -1
|
z: -1
|
||||||
border.width: 2
|
border.width: 2
|
||||||
border.color: Qt.darker(palette.window, 1.1)
|
border.color: Qt.darker(palette.window, 1.1)
|
||||||
}
|
}*/
|
||||||
|
|
||||||
onEditingFinished: _reconstruction.setAttribute(attribute, text)
|
onEditingFinished: _reconstruction.setAttribute(attribute, text)
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
@ -65,6 +89,7 @@ RowLayout {
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: int_component
|
id: int_component
|
||||||
|
|
||||||
TextInput{
|
TextInput{
|
||||||
text: model.display.value
|
text: model.display.value
|
||||||
color: 'white'
|
color: 'white'
|
||||||
|
@ -78,14 +103,14 @@ RowLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
validator: intValidator
|
validator: intValidator
|
||||||
|
/*
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
||||||
z: -1
|
z: -1
|
||||||
border.width: 2
|
border.width: 2
|
||||||
border.color: Qt.darker(palette.window, 1.1)
|
border.color: Qt.darker(palette.window, 1.1)
|
||||||
}
|
}*/
|
||||||
|
|
||||||
onEditingFinished: _reconstruction.setAttribute(attribute, Number(text))
|
onEditingFinished: _reconstruction.setAttribute(attribute, Number(text))
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
@ -110,13 +135,14 @@ RowLayout {
|
||||||
leftInset: 6
|
leftInset: 6
|
||||||
rightInset: 6
|
rightInset: 6
|
||||||
bottomInset: 7
|
bottomInset: 7
|
||||||
Rectangle {
|
|
||||||
|
/*Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
||||||
z: -1
|
z: -1
|
||||||
border.width: 2
|
border.width: 2
|
||||||
border.color: Qt.darker(palette.window, 1.1)
|
border.color: Qt.darker(palette.window, 1.1)
|
||||||
}
|
}*/
|
||||||
Connections {
|
Connections {
|
||||||
target: attribute
|
target: attribute
|
||||||
onValueChanged: combo.currentIndex = combo.find(attribute.value)
|
onValueChanged: combo.currentIndex = combo.find(attribute.value)
|
||||||
|
@ -130,20 +156,20 @@ RowLayout {
|
||||||
checked: attribute ? attribute.value : false
|
checked: attribute ? attribute.value : false
|
||||||
padding: 12
|
padding: 12
|
||||||
onToggled: _reconstruction.setAttribute(attribute, !attribute.value)
|
onToggled: _reconstruction.setAttribute(attribute, !attribute.value)
|
||||||
|
/*
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
||||||
z: -1
|
z: -1
|
||||||
border.width: 2
|
border.width: 2
|
||||||
border.color: Qt.darker(palette.window, 1.1)
|
border.color: Qt.darker(palette.window, 1.1)
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: float_component
|
id: float_component
|
||||||
TextInput{
|
TextInput{
|
||||||
//readonly property int stepDecimalCount: stepSize < 1 ? String(stepSize).split(".").pop().length : 0
|
|
||||||
readonly property real formattedValue: model.display.value.toFixed(2)
|
readonly property real formattedValue: model.display.value.toFixed(2)
|
||||||
property string displayValue: String(formattedValue)
|
property string displayValue: String(formattedValue)
|
||||||
text: displayValue
|
text: displayValue
|
||||||
|
@ -173,14 +199,16 @@ RowLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
validator: doubleValidator
|
validator: doubleValidator
|
||||||
|
/*
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
color: rowIndex % 2 ? palette.window : Qt.darker(palette.window, 1.1)
|
||||||
z: -1
|
z: -1
|
||||||
border.width: 2
|
border.width: 2
|
||||||
border.color: Qt.darker(palette.window, 1.1)
|
border.color: Qt.darker(palette.window, 1.1)
|
||||||
}
|
ToolTip.text: "HELLOOOOO"
|
||||||
|
ToolTip.visible: true
|
||||||
|
}*/
|
||||||
onEditingFinished: _reconstruction.setAttribute(attribute, Number(text))
|
onEditingFinished: _reconstruction.setAttribute(attribute, Number(text))
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
_reconstruction.setAttribute(attribute, Number(text))
|
_reconstruction.setAttribute(attribute, Number(text))
|
||||||
|
@ -192,7 +220,4 @@ RowLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue