mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-08 22:01:59 +02:00
[ui] AttributeEditor: add contextual menu on attributes
* allow to expose additional actions on individuals attributes * add 'Reset to Default Value' action
This commit is contained in:
parent
4a71ebb212
commit
c45ebdf83c
1 changed files with 16 additions and 0 deletions
|
@ -49,8 +49,24 @@ RowLayout {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
|
|
||||||
|
property Component menuComp: Menu {
|
||||||
|
id: paramMenu
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
text: "Reset To Default Value"
|
||||||
|
enabled: !attribute.isOutput && !attribute.isLink && !attribute.isDefault
|
||||||
|
onTriggered: _reconstruction.resetAttribute(attribute)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
|
if(mouse.button == Qt.RightButton)
|
||||||
|
{
|
||||||
|
var menu = menuComp.createObject(parameterLabel)
|
||||||
|
menu.parent = parameterLabel
|
||||||
|
menu.popup()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue