From 79338f76be1d8e7093ee0bd2f09047ef2ec3c405 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 16 Mar 2021 13:14:07 +0100 Subject: [PATCH] feat(ModalPopup): hide footer section if footerContent height is 0 In the recent past we've improved our `ModalPopup` to allow for a bit more control when it comes to rendering a modal footer section with call-to-action items. The footer section is rendered when there's `footerContent` and when the height of the footer content is > 0. This means it's possible to also hide the footer content section from the modal, even when there's footer content children. However, there's a separator rendered whenver the footer is visible, regardless of its height. This results in undesired behaviour when rendering footer children of height 0. To avoid this, this commit adjust the condition so that the separator is only rendered when the footer visible AND the height of it is > 0. --- ui/shared/ModalPopup.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/shared/ModalPopup.qml b/ui/shared/ModalPopup.qml index d001d47cc1..f641474b87 100644 --- a/ui/shared/ModalPopup.qml +++ b/ui/shared/ModalPopup.qml @@ -126,7 +126,7 @@ Popup { Separator { id: separator2 - visible: footerContent.visible + visible: footerContent.visible && footerContent.height > 0 anchors.bottom: footerContent.top anchors.bottomMargin: visible ? Style.current.padding : 0 }