From e99719a08fb32338aafaaa13646e483580bae7b3 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Thu, 29 Dec 2022 13:35:24 +0100 Subject: [PATCH] Correct solution to width being incorrect after height resize. CURA-9522 --- resources/qml/Menus/MaterialBrandSubMenu.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/Menus/MaterialBrandSubMenu.qml b/resources/qml/Menus/MaterialBrandSubMenu.qml index 1cd9d04b5c..9c237d12fe 100644 --- a/resources/qml/Menus/MaterialBrandSubMenu.qml +++ b/resources/qml/Menus/MaterialBrandSubMenu.qml @@ -67,6 +67,10 @@ Popup } } + // Changing the height causes implicitWidth to change because of the scrollbar appearing/disappearing + // Reassign it here to update the value + materialBrandSubMenu.width = implicitWidth; + if (globalPosition.x > mainWindow.width - materialBrandSubMenu.width) { if (mainWindow.width > materialBrandSubMenu.width) @@ -81,10 +85,6 @@ Popup materialBrandSubMenu.width = mainWindow.width; } } - - - // This function can cause the scrollbar.width to update but this won't update the width (bug?) so it is done explicitly here. - width = scrollViewContent.width + scrollbar.width + leftPadding + rightPadding } padding: background.border.width