mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +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()
|
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 {
|
Action {
|
||||||
id: loadTemplateAction
|
id: loadTemplateAction
|
||||||
|
|
||||||
|
@ -804,6 +836,11 @@ ApplicationWindow {
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
ToolTip.text: pasteAction.tooltip
|
ToolTip.text: pasteAction.tooltip
|
||||||
}
|
}
|
||||||
|
MenuItem {
|
||||||
|
action: cutAction
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
ToolTip.text: cutAction.tooltip
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Menu {
|
Menu {
|
||||||
title: "View"
|
title: "View"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue