From 3dff780215d6488729f7c8ad7dd3e1993dc07ef5 Mon Sep 17 00:00:00 2001 From: Joey de l'Arago Date: Tue, 6 Dec 2022 15:36:55 +0100 Subject: [PATCH] Adjust location of popups so they align with their parent popup. CURA-9793 --- resources/qml/Menus/MaterialBrandMenu.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/MaterialBrandMenu.qml b/resources/qml/Menus/MaterialBrandMenu.qml index e096847016..396a7c2123 100644 --- a/resources/qml/Menus/MaterialBrandMenu.qml +++ b/resources/qml/Menus/MaterialBrandMenu.qml @@ -106,7 +106,7 @@ Cura.MenuItem // The popup is longer than the distance between the hovered item and the bottom of the item list. // This pushes the popup upwards until the bottom lines up with the parent bottom. // Only when popup is longer than the parent, the popup will flow out below the parent. - var topOfParent = parent.y + (3 * UM.Theme.getSize("default_lining").height) + var topOfParent = parent.y + UM.Theme.getSize("narrow_margin").height return -Math.min(parent.y - (materialBrandMenu.parent.height - popupHeight ), topOfParent) } } @@ -260,8 +260,8 @@ Cura.MenuItem // The popup is longer than the distance between the hovered item and the bottom of the item list. // This pushes the popup upwards until the bottom lines up with the parent bottom. // Only when popup is longer than the parent, the popup will flow out below the parent. - var topOfParent = parent.y + (3 * UM.Theme.getSize("default_lining").height) - return -Math.min(parent.y - (materialTypesList.height - popupHeight), parent.y) + var topOfParent = parent.y + UM.Theme.getSize("default_lining").height + return -Math.min(parent.y - (materialTypesList.height - popupHeight - UM.Theme.getSize("default_lining").height), topOfParent) } }