From 845b3209819f8e7b1449c15118c6c995b2c548c3 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 26 Nov 2018 13:08:30 +0100 Subject: [PATCH] Fix adjustable monitor component width CURA-5943 - Add rounding - If there's no sidebar, use full width --- plugins/MonitorStage/MonitorMainView.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/MonitorStage/MonitorMainView.qml b/plugins/MonitorStage/MonitorMainView.qml index 57dd033792..f5696bbf54 100644 --- a/plugins/MonitorStage/MonitorMainView.qml +++ b/plugins/MonitorStage/MonitorMainView.qml @@ -38,7 +38,10 @@ Item anchors.bottom: parent.bottom anchors.left: parent.left - width: parent.width * 0.7 + // If the sidebar is not set, the view should take the complete space. + property var widthFactor: monitorSidebarComponent.source == "" ? 1.0 : 0.7 + + width: Math.round(parent.width * widthFactor) height: parent.height property real maximumWidth: parent.width