From 5a3675df953f120420235566286ef1f3a215163c Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Tue, 29 Jun 2021 10:54:46 +0200 Subject: [PATCH] Calculate the width of the header items only once CURA-8013 --- plugins/PrepareStage/PrepareMenu.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index 1c66979a6c..0a452da4a6 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -42,6 +42,7 @@ Item anchors.left: openFileButton.right anchors.right: parent.right anchors.leftMargin: UM.Theme.getSize("default_margin").width + property int machineSelectorWidth: Math.round((width - printSetupSelectorItem.width) / 3) height: parent.height // This is a trick to make sure that the borders of the two adjacent buttons' borders overlap. Otherwise @@ -55,7 +56,7 @@ Item headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width headerBackgroundBorder.color: UM.Theme.getColor("lining") enableHeaderShadow: false - Layout.preferredWidth: Math.round((itemRow.width - printSetupSelectorItem.width - UM.Theme.getSize("default_lining").width) * 1 / 3 - UM.Theme.getSize("default_lining").width) + Layout.preferredWidth: parent.machineSelectorWidth Layout.fillWidth: true Layout.fillHeight: true } @@ -68,7 +69,7 @@ Item headerBackgroundBorder.color: UM.Theme.getColor("lining") Layout.fillHeight: true Layout.fillWidth: true - Layout.preferredWidth: Math.round((itemRow.width - printSetupSelectorItem.width - UM.Theme.getSize("default_lining").width) * 2 / 3 - UM.Theme.getSize("default_lining").width) + Layout.preferredWidth: parent.machineSelectorWidth * 2 } Item