mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] Viewer2D: enabled status on panorama and lens buttons
This commit is contained in:
parent
7c5752e71f
commit
efb570c306
1 changed files with 26 additions and 2 deletions
|
@ -801,7 +801,19 @@ FocusScope {
|
||||||
MaterialToolButton {
|
MaterialToolButton {
|
||||||
id: displayLensDistortionViewer
|
id: displayLensDistortionViewer
|
||||||
property var activeNode: root.aliceVisionPluginAvailable ? _reconstruction.activeNodes.get('sfm').node : null
|
property var activeNode: root.aliceVisionPluginAvailable ? _reconstruction.activeNodes.get('sfm').node : null
|
||||||
property bool isComputed: activeNode && activeNode.isComputed
|
property bool isComputed: {
|
||||||
|
if(!activeNode)
|
||||||
|
return false;
|
||||||
|
if(activeNode.isComputed)
|
||||||
|
return true;
|
||||||
|
var inputAttr = activeNode.attribute("input");
|
||||||
|
if(!inputAttr)
|
||||||
|
return false;
|
||||||
|
var inputAttrLink = inputAttr.rootLinkParam;
|
||||||
|
if(!inputAttrLink)
|
||||||
|
return false;
|
||||||
|
return inputAttrLink.node.isComputed;
|
||||||
|
}
|
||||||
|
|
||||||
ToolTip.text: "Lens Distortion Viewer"
|
ToolTip.text: "Lens Distortion Viewer"
|
||||||
text: MaterialIcons.panorama_horizontal
|
text: MaterialIcons.panorama_horizontal
|
||||||
|
@ -830,7 +842,19 @@ FocusScope {
|
||||||
Layout.minimumWidth: 0
|
Layout.minimumWidth: 0
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: false
|
checked: false
|
||||||
enabled: activeNode && isComputed && (activeNode.attribute("method").value === "manual")
|
enabled: {
|
||||||
|
if(!activeNode)
|
||||||
|
return false;
|
||||||
|
if(activeNode.attribute("method").value !== "manual")
|
||||||
|
return false;
|
||||||
|
var inputAttr = activeNode.attribute("input");
|
||||||
|
if(!inputAttr)
|
||||||
|
return false;
|
||||||
|
var inputAttrLink = inputAttr.rootLinkParam;
|
||||||
|
if(!inputAttrLink)
|
||||||
|
return false;
|
||||||
|
return inputAttrLink.node.isComputed;
|
||||||
|
}
|
||||||
onCheckedChanged : {
|
onCheckedChanged : {
|
||||||
if((displayHDR.checked || displayLensDistortionViewer.checked) && checked){
|
if((displayHDR.checked || displayLensDistortionViewer.checked) && checked){
|
||||||
displayHDR.checked = false;
|
displayHDR.checked = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue