Cura/plugins/UM3NetworkPrinting/resources/qml/PrinterVideoStream.qml
Jaime van Kessel 70e4e9640e
Revert "Merge pull request #9716 from Ultimaker/CURA-8010_new_icons"
This reverts commit 6120d8a054b8c04bf90b8b3d3cb219d691bece2f, reversing
changes made to 95652556fef90f70adbf25bfa9bd3b8af7220d4a.
2021-05-27 16:06:20 +02:00

66 lines
1.7 KiB
QML

// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM
import Cura 1.0 as Cura
Item {
property var cameraUrl: "";
Rectangle {
anchors.fill:parent;
color: UM.Theme.getColor("viewport_overlay");
opacity: 0.5;
}
MouseArea {
anchors.fill: parent;
onClicked: OutputDevice.setActiveCameraUrl("");
z: 0;
}
CameraButton {
id: closeCameraButton;
anchors {
right: cameraImage.right
rightMargin: UM.Theme.getSize("default_margin").width
top: cameraImage.top
topMargin: UM.Theme.getSize("default_margin").height
}
iconSource: UM.Theme.getIcon("cross1");
z: 999;
}
Cura.NetworkMJPGImage {
id: cameraImage
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
height: Math.round((imageHeight === 0 ? 600 * screenScaleFactor : imageHeight) * width / imageWidth);
onVisibleChanged: {
if (visible) {
if (cameraUrl != "") {
start();
}
} else {
if (cameraUrl != "") {
stop();
}
}
}
source: cameraUrl
width: Math.min(imageWidth === 0 ? 800 * screenScaleFactor : imageWidth, maximumWidth);
z: 1
}
MouseArea {
anchors.fill: cameraImage;
onClicked: {
OutputDevice.setActiveCameraUrl("");
}
z: 1;
}
}