From 1c83b152903b730d2d0915bba6d159da2751fa22 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 22 Jun 2016 14:17:56 +0200 Subject: [PATCH] Tweak viewport overlay Change color, opacity. Block mouseclicks. CURA-1036 --- resources/qml/Cura.qml | 20 ++++++++++++++++---- resources/themes/cura/theme.json | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index bfb18d3d61..a9e9f0c875 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -534,9 +534,12 @@ UM.MainWindow onMonitoringPrintChanged: base.monitoringPrint = monitoringPrint width: UM.Theme.getSize("sidebar").width; } + Rectangle { - color: "black" + id: viewportOverlay + + color: UM.Theme.getColor("viewport_overlay") anchors { top: parent.top @@ -544,8 +547,17 @@ UM.MainWindow left:parent.left right: sidebar.left } - visible: base.monitoringPrint - opacity: 0.5 + visible: opacity > 0 + opacity: base.monitoringPrint ? 0.75 : 0 + + Behavior on opacity { NumberAnimation { duration: 100; } } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.AllButtons + + onWheel: wheel.accepted = true + } } Image @@ -555,7 +567,7 @@ UM.MainWindow height: 600 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenterOffset: -(UM.Theme.getSize("sidebar").width/ 2) + anchors.horizontalCenterOffset: - UM.Theme.getSize("sidebar").width / 2 visible: base.monitoringPrint source: Cura.MachineManager.printerOutputDevices[0].cameraImage } diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index acd60e2646..9c2b9f7b03 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -38,6 +38,7 @@ "colors": { "sidebar": [255, 255, 255, 255], "lining": [127, 127, 127, 255], + "viewport_overlay": [24, 41, 77, 255], "primary": [12, 169, 227, 255], "primary_hover": [48, 182, 231, 255],