mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 16:57:51 -06:00
Monitor Tab - Create reusable button
Contributes to CL-1049
This commit is contained in:
parent
dccc95f817
commit
08d5e48407
2 changed files with 52 additions and 32 deletions
|
@ -626,41 +626,14 @@ Component
|
|||
color: "black"
|
||||
}
|
||||
|
||||
Rectangle
|
||||
DotButton
|
||||
{
|
||||
id: showCameraButton
|
||||
width: 36 * screenScaleFactor
|
||||
height: width
|
||||
radius: 0.5 * width
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: printJobPreview.bottom
|
||||
color: showCameraMouseArea.containsMouse ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary")
|
||||
UM.RecolorImage
|
||||
iconSource: "../svg/camera-icon.svg"
|
||||
anchors
|
||||
{
|
||||
id: showCameraIcon
|
||||
width: parent.width - 1
|
||||
height: width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
source: "../svg/camera-icon.svg"
|
||||
}
|
||||
MouseArea
|
||||
{
|
||||
id: showCameraMouseArea
|
||||
anchors.fill:parent
|
||||
hoverEnabled: true
|
||||
onClicked:
|
||||
{
|
||||
if (OutputDevice.activeCamera !== null)
|
||||
{
|
||||
OutputDevice.setActiveCamera(null)
|
||||
}
|
||||
else
|
||||
{
|
||||
OutputDevice.setActiveCamera(modelData.camera)
|
||||
}
|
||||
}
|
||||
left: parent.left
|
||||
bottom: printJobPreview.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue