From e56076af08a55905eb22b1fea1bf8d0cd2151ea2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Oct 2021 18:09:47 +0200 Subject: [PATCH] Render material spool somewhat bigger and give it a margin The image of the spool doesn't have a margin by itself, contrary to the other images which have a visual margin given by the size of the table. We have to give it a margin manually. This is one of the consequences of encoding margins inside of images that may be used all over the place. We can't just remove the margins inside of the image because the laptop image will be used in other places too. Just adding a margin would subtract from the size of the spool image making it very small. To compensate I'm making the spool image slightly bigger. Contributes to issue CURA-8609. --- .../Materials/MaterialsSyncDialog.qml | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index 303b9cfbf5..1b6be74f84 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -47,20 +47,32 @@ Window } Row { + /* + This is a row with 3 images, and a dashed line between each of them. + The images have various sizes, scaled to the window size: + - The computer screen and 3D printer have 1/3rd of the window size each. + - The remaining space is 2/3rds filled with the material spool image (so 2/9th in total). + - The remaining remaining space is divided equally over the two dashed lines (so 1/9th in total, or 1/18th per line). + */ width: parent.width height: parent.height * 2 / 3 - Image + Item { - id: spool_image - source: UM.Theme.getImage("material_spool") - width: Math.round(parent.width / 6) - anchors.bottom: parent.bottom - fillMode: Image.PreserveAspectFit - sourceSize.width: width + width: Math.round(parent.width * 2 / 9) + height: parent.height + Image + { + id: spool_image + source: UM.Theme.getImage("material_spool") + width: parent.width - UM.Theme.getSize("default_margin").width + anchors.bottom: parent.bottom + fillMode: Image.PreserveAspectFit + sourceSize.width: width + } } Canvas { - width: Math.round(parent.width / 12) + width: Math.round(parent.width / 18) height: UM.Theme.getSize("thick_lining").width onPaint: { var ctx = getContext("2d"); @@ -84,7 +96,7 @@ Window } Canvas { - width: Math.round(parent.width / 12) + width: Math.round(parent.width / 18) height: UM.Theme.getSize("thick_lining").width onPaint: { var ctx = getContext("2d");