From 78f15d8fcb0b95f0e5532cb58be02162b19b1140 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Mon, 22 Apr 2019 23:35:58 +0200 Subject: [PATCH] Margins to main window for draggable component. --- resources/qml/ExpandableComponent.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 662dd1d6c4..b30ef70189 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -247,11 +247,12 @@ Item var delta = Qt.point(mouse.x - clickPos.x, mouse.y - clickPos.y); if (delta.x !== 0 || delta.y !== 0) { - var minPt = base.mapFromItem(null, 0, 0); + var margin = UM.Theme.getSize("narrow_margin"); + var minPt = base.mapFromItem(null, margin.width, margin.height); var maxPt = base.mapFromItem(null, - CuraApplication.appWidth() - contentContainer.width, - CuraApplication.appHeight() - contentContainer.height); - var initialY = background.height + base.shadowOffset + base.contentSpacingY; + CuraApplication.appWidth() - (contentContainer.width + margin.width), + CuraApplication.appHeight() - (contentContainer.height + margin.width)); + var initialY = background.height + base.shadowOffset + margin.height; contentContainer.x = Math.min(maxPt.x, Math.max(minPt.x, contentContainer.x + delta.x)); contentContainer.y = Math.min(maxPt.y, Math.max(initialY, contentContainer.y + delta.y));