fix: fix PopupModal to not show a footer at all if there is no children

This commit is contained in:
Jonathan Rainville 2021-01-13 14:15:52 -05:00 committed by Iuri Matias
parent 39d72c5f79
commit e459d4dbd4
21 changed files with 55 additions and 61 deletions

View File

@ -102,7 +102,7 @@ ModalPopup {
footer: Item {
width: parent.width
height: parent.height
height: removeBtn.height
StatusButton {
id: removeBtn

View File

@ -51,10 +51,8 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.bottom
anchors.right: parent.right
anchors.bottom: root.bottom
anchors.left: parent.left
width: parent.width
height: okButton.height
StyledButton {
id: okButton

View File

@ -192,9 +192,8 @@ ModalPopup {
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnReject.height
StatusButton {
id: btnReject

View File

@ -122,9 +122,9 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnNext.height
StatusRoundButton {
id: btnBack
anchors.left: parent.left

View File

@ -227,9 +227,9 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnNext.height
StatusRoundButton {
id: btnBack
anchors.left: parent.left

View File

@ -127,9 +127,11 @@ ModalPopup {
}
footer: Item {
anchors.fill: parent
width: parent.width
height: importBtn.height
StatusButton {
id: importBtn
text: qsTr("Import a community")
anchors.right: createBtn.left
anchors.rightMargin: Style.current.smallPadding

View File

@ -140,7 +140,8 @@ ModalPopup {
}
footer: Item {
anchors.fill: parent
width: parent.width
height: backButton.height
StatusIconButton {
id: backButton

View File

@ -86,7 +86,8 @@ ModalPopup {
}
footer: Item {
anchors.fill: parent
width: parent.width
height: inviteBtn.height
StatusRoundButton {
id: btnBack

View File

@ -136,10 +136,8 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.bottom
anchors.right: parent.right
anchors.bottom: popup.bottom
anchors.left: parent.left
width: parent.width
height: btnSelectMembers.height
Button {
id: btnSelectMembers

View File

@ -101,7 +101,8 @@ ModalPopup {
}
footer: Item {
anchors.fill:parent
width: parent.width
height: uploadBtn.height
StatusButton {
visible: profileModel.profile.hasIdentityImage

View File

@ -85,10 +85,8 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.bottom
anchors.right: parent.right
anchors.bottom: popup.bottom
anchors.left: parent.left
width: parent.width
height: btnSelectPreferred.height
Button {
id: btnSelectPreferred

View File

@ -149,9 +149,8 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnNext.height
StatusButton {
id: btnNext

View File

@ -153,9 +153,8 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnNext.height
StyledButton {
id: btnNext

View File

@ -105,7 +105,9 @@ ModalPopup {
}
footer: Item {
anchors.fill: parent
width: parent.width
height: saveBtn.height
StyledButton {
visible: currentAccount.walletType === Constants.watchWalletType
anchors.top: parent.top

View File

@ -131,8 +131,10 @@ ModalPopup {
}
footer: Item {
width: parent.width
height: addBtn.height
visible: editable
anchors.fill: parent
StyledButton {
id: addBtn
anchors.top: parent.top

View File

@ -181,9 +181,9 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnNext.height
StatusRoundButton {
id: btnBack
anchors.left: parent.left

View File

@ -75,9 +75,8 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnRemindLater.height
StatusButton {
anchors.right: btnRemindLater.left

View File

@ -92,10 +92,8 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.bottom
anchors.right: parent.right
anchors.bottom: popup.bottom
anchors.left: parent.left
width: parent.width
height: submitBtn.height
StatusButton {
id: submitBtn

View File

@ -56,12 +56,11 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.bottom
anchors.right: parent.right
anchors.bottom: popup.bottom
anchors.left: parent.left
width: parent.width
height: reencryptBtn.height
StatusButton {
id: reencryptBtn
anchors.bottom: parent.bottom
anchors.topMargin: Style.current.padding
anchors.right: parent.right

View File

@ -126,24 +126,22 @@ Popup {
Separator {
id: separator2
visible: !!footerContent.children[0]
anchors.bottom: parent.bottom
anchors.bottomMargin: 75
visible: footerContent.visible
anchors.bottom: footerContent.top
anchors.bottomMargin: visible ? Style.current.padding : 0
}
Item {
id: footerContent
visible: !!children[0]
height: children[0] && children[0].height
visible: children.length > 0
height: visible ? children[0] && children[0].height : 0
width: parent.width
anchors.top: separator2.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.topMargin: Style.current.padding
anchors.bottomMargin: Style.current.padding
anchors.rightMargin: Style.current.padding
anchors.leftMargin: Style.current.padding
anchors.bottomMargin: visible ? Style.current.padding : 0
anchors.rightMargin: visible ? Style.current.padding : 0
anchors.leftMargin: visible ? Style.current.padding : 0
}
}
}

View File

@ -165,9 +165,9 @@ ModalPopup {
}
footer: Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: btnNext.height
StatusRoundButton {
id: btnBack
anchors.left: parent.left