mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Re-implement monitor view overlay when there is no monitor component
This commit is contained in:
parent
f6b570e299
commit
dd92d8d5e0
2 changed files with 29 additions and 6 deletions
|
|
@ -6,11 +6,34 @@ import QtQuick.Controls 1.1
|
||||||
import UM 1.3 as UM
|
import UM 1.3 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
Loader
|
Item
|
||||||
{
|
{
|
||||||
|
// We show a nice overlay on the 3D viewer when the current output device has no monitor view
|
||||||
|
Rectangle
|
||||||
|
{
|
||||||
|
id: viewportOverlay
|
||||||
|
|
||||||
|
color: UM.Theme.getColor("viewport_overlay")
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
visible: monitorViewComponent.sourceComponent == null ? 1 : 0
|
||||||
|
|
||||||
|
MouseArea
|
||||||
|
{
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.AllButtons
|
||||||
|
onWheel: wheel.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader
|
||||||
|
{
|
||||||
|
id: monitorViewComponent
|
||||||
|
|
||||||
property real maximumWidth: parent.width
|
property real maximumWidth: parent.width
|
||||||
property real maximumHeight: parent.height
|
property real maximumHeight: parent.height
|
||||||
|
|
||||||
sourceComponent: Cura.MachineManager.printerOutputDevices.length > 0 ? Cura.MachineManager.printerOutputDevices[0].monitorItem: null
|
sourceComponent: Cura.MachineManager.printerOutputDevices.length > 0 ? Cura.MachineManager.printerOutputDevices[0].monitorItem: null
|
||||||
visible: sourceComponent != null
|
visible: sourceComponent != null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class MonitorStage(CuraStage):
|
||||||
self.addDisplayComponent("main", main_component_path)
|
self.addDisplayComponent("main", main_component_path)
|
||||||
|
|
||||||
def _setSidebar(self):
|
def _setSidebar(self):
|
||||||
# Note: currently the sidebar component for prepare and monitor stages is the same, this will change with the printer output device refactor!
|
# TODO: currently the sidebar component for prepare and monitor stages is the same, this will change with the printer output device refactor!
|
||||||
sidebar_component_path = os.path.join(Resources.getPath(Application.getInstance().ResourceTypes.QmlFiles), "Sidebar.qml")
|
sidebar_component_path = os.path.join(Resources.getPath(Application.getInstance().ResourceTypes.QmlFiles), "Sidebar.qml")
|
||||||
self.addDisplayComponent("sidebar", sidebar_component_path)
|
self.addDisplayComponent("sidebar", sidebar_component_path)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue