fix(StatusModal): render footer correctly based on `showFooter` flag

This commit is contained in:
Pascal Precht 2021-10-29 13:28:49 +02:00 committed by r4bbit.eth
parent d301b94c70
commit da9dc2f46a
2 changed files with 5 additions and 3 deletions

View File

@ -67,7 +67,7 @@ QC.Popup {
id: footerImpl id: footerImpl
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: visible ? parent.width : 0 width: visible ? parent.width : 0
visible: statusModal.showFooter showFooter: statusModal.showFooter
} }
} }
} }

View File

@ -13,6 +13,7 @@ Rectangle {
property list<Item> leftButtons property list<Item> leftButtons
property list<StatusBaseButton> rightButtons property list<StatusBaseButton> rightButtons
property bool showFooter: true
radius: 8 radius: 8
@ -30,7 +31,7 @@ Rectangle {
} }
} }
implicitHeight: visible ? rootLayout.implicitHeight + 30 : 0 implicitHeight: rootLayout.implicitHeight + 30
RowLayout { RowLayout {
id: rootLayout id: rootLayout
@ -43,6 +44,7 @@ Rectangle {
Row { Row {
id: leftButtonsLayout id: leftButtonsLayout
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
visible: statusModalFooter.showFooter
spacing: 16 spacing: 16
} }
@ -55,9 +57,9 @@ Rectangle {
Row { Row {
id: rightButtonsLayout id: rightButtonsLayout
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
visible: statusModalFooter.showFooter
spacing: 16 spacing: 16
} }
} }