After switching the Monitor Tab set Null to active output printer

CURA-5612
This commit is contained in:
Aleksei S 2018-08-03 11:42:55 +02:00
parent aadbebd457
commit 9c8ac6e9ed
2 changed files with 17 additions and 4 deletions

View file

@ -9,6 +9,7 @@ Component
{ {
Rectangle Rectangle
{ {
id: rectangle
width: maximumWidth width: maximumWidth
height: maximumHeight height: maximumHeight
color: UM.Theme.getColor("viewport_background") color: UM.Theme.getColor("viewport_background")
@ -103,5 +104,15 @@ Component
visible: OutputDevice.activePrinter != null visible: OutputDevice.activePrinter != null
anchors.fill:parent anchors.fill:parent
} }
onVisibleChanged:
{
if(rectangle != null && !rectangle.visible)
{
// After switching the Tab ensure that active printer is Null, the video stream image
// might be active
OutputDevice.setActivePrinter(null)
}
}
} }
} }

View file

@ -90,8 +90,10 @@ Item
MouseArea MouseArea
{ {
anchors.fill: cameraImage anchors.fill: cameraImage
onClicked: { /* no-op */ } onClicked:
{
OutputDevice.setActivePrinter(null)
}
z: 1 z: 1
} }
} }