mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 08:48:40 +02:00
[ui] Add of Cut option in Edit menu
This commit is contained in:
parent
c3ab36deb0
commit
f0e18e6db9
1 changed files with 37 additions and 0 deletions
|
@ -558,6 +558,38 @@ ApplicationWindow {
|
|||
onTriggered: graphEditor.pasteNodes()
|
||||
}
|
||||
|
||||
Action {
|
||||
id: cutAction
|
||||
|
||||
property string tooltip: {
|
||||
var s = "Copy selected node"
|
||||
s += (_reconstruction && _reconstruction.selectedNodes.count > 1 ? "s (" : " (") + getSelectedNodesName()
|
||||
s += ") to the clipboard and remove them from the graph"
|
||||
return s
|
||||
}
|
||||
text: "Cut Node" + (_reconstruction && _reconstruction.selectedNodes.count > 1 ? "s " : " ")
|
||||
enabled: _reconstruction ? _reconstruction.selectedNodes.count > 0 : false
|
||||
onTriggered: {
|
||||
graphEditor.copyNodes()
|
||||
graphEditor.uigraph.removeNodes(graphEditor.uigraph.selectedNodes)
|
||||
}
|
||||
|
||||
function getSelectedNodesName()
|
||||
{
|
||||
if (!_reconstruction)
|
||||
return ""
|
||||
var nodesName = ""
|
||||
for (var i = 0; i < _reconstruction.selectedNodes.count; i++)
|
||||
{
|
||||
if (nodesName !== "")
|
||||
nodesName += ", "
|
||||
var node = _reconstruction.selectedNodes.at(i)
|
||||
nodesName += node.name
|
||||
}
|
||||
return nodesName
|
||||
}
|
||||
}
|
||||
|
||||
Action {
|
||||
id: loadTemplateAction
|
||||
|
||||
|
@ -804,6 +836,11 @@ ApplicationWindow {
|
|||
ToolTip.visible: hovered
|
||||
ToolTip.text: pasteAction.tooltip
|
||||
}
|
||||
MenuItem {
|
||||
action: cutAction
|
||||
ToolTip.visible: hovered
|
||||
ToolTip.text: cutAction.tooltip
|
||||
}
|
||||
}
|
||||
Menu {
|
||||
title: "View"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue