mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-03 11:21:52 +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
|
||||
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: {
|
||||
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