Cura/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml
Ghostkeeper 0a75c772ed
Unrevert new icon set for all of Cura's interface
We created a new set of icons for Cura. These icons had to be reverted though because they weren't working out in the interface for the last release yet.
This unreverts them, basically adding them back hoping that we'll get them fixed in time for the next release.

Contributes to issue CURA-8342.

Revert "Revert "Fix merge conflict""

This reverts commit bb20e3307f43edc1ff53cb154d2351ddfe39e158.

Revert "Revert "Merge pull request #9716 from Ultimaker/CURA-8010_new_icons""

This reverts commit 70e4e9640e561e18a12870f30c905203ce8ccee7.

Revert "Revert "Fix typo in icon name""

This reverts commit 38ce22ba7c3f40b971bc6e1e0a8e776ca9d51512.

Revert "Revert "Add list for deprecated icons""

This reverts commit 119a957e7f978dbf1ddbcb3b0005bf38e8fed943.

Revert "Revert "Add Function icon""

This reverts commit 760726cf0bb953bb1b0fc277b448f419d4bd2544.

Revert "Revert "Switch out inherit icon""

This reverts commit 26afff609381e2004d194c280f504b6226859bd3.

Revert "Revert "Merge branch 'CURA-8205_Introduce_new_icons_in_Cura' of github.com:Ultimaker/Cura""

This reverts commit 6483db3d47ee052c1a966cdee3af7190577a5769.

Revert "Fix incorrect icons"

This reverts commit 02a4ade2a50a943ff36fd4895bdc9261cf2133eb.
2021-06-28 17:16:56 +02:00

102 lines
2.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 2.0
import UM 1.3 as UM
// TODO: Documentation!
Item
{
id: printJobPreview
property var printJob: null
property var size: 256
width: size
height: size
Rectangle
{
anchors.fill: parent
color: printJob ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading")
radius: 8 // TODO: Theme!
Image
{
id: previewImage
anchors.fill: parent
opacity:
{
if (printJob && (printJob.state == "error" || printJob.configurationChanges.length > 0 || !printJob.isActive))
{
return 0.5
}
return 1.0
}
source: printJob ? printJob.previewImageUrl : ""
}
}
UM.RecolorImage
{
id: ultiBotImage
anchors.centerIn: printJobPreview
color: UM.Theme.getColor("monitor_placeholder_image")
height: printJobPreview.height
source: "../svg/ultibot.svg"
sourceSize
{
height: height
width: width
}
/* Since print jobs ALWAYS have an image url, we have to check if that image URL errors or
not in order to determine if we show the placeholder (ultibot) image instead. */
visible: printJob && previewImage.status == Image.Error
width: printJobPreview.width
}
UM.RecolorImage
{
id: overlayIcon
anchors.centerIn: printJobPreview
color: UM.Theme.getColor("monitor_image_overlay")
height: 0.5 * printJobPreview.height
source:
{
if (!printJob)
{
return ""
}
if (printJob.configurationChanges.length > 0)
{
return "../svg/Warning.svg"
}
switch(printJob.state)
{
case "error":
return "../svg/CancelCircle.svg"
case "wait_cleanup":
return printJob.timeTotal > printJob.timeElapsed ? "../svg/CancelCircle.svg" : ""
case "pausing":
return "../svg/PauseCircle.svg"
case "paused":
return "../svg/PauseCircle.svg"
case "resuming":
return "../svg/PauseCircle.svg"
default:
return ""
}
return ""
}
sourceSize
{
height: height
width: width
}
visible: source != ""
width: 0.5 * printJobPreview.width
}
}