fix(StatusModal): Added support for advanced footer and header as seen in new designs.

It is also backward compatible and is not a breaking change.
This commit is contained in:
Khushboo Mehta 2022-03-22 18:42:54 +01:00 committed by r4bbit.eth
parent 5f8f798cf2
commit 03eb6302d5
1 changed files with 21 additions and 0 deletions

View File

@ -11,6 +11,10 @@ import "statusModal" as Spares
QC.Popup { QC.Popup {
id: statusModal id: statusModal
property alias advancedHeader: advancedHeader.item
property alias advancedFooter: advancedFooter.item
property alias advancedHeaderComponent: advancedHeader.sourceComponent
property alias advancedFooterComponent: advancedFooter.sourceComponent
property alias headerActionButton: headerImpl.actionButton property alias headerActionButton: headerImpl.actionButton
property StatusModalHeaderSettings header: StatusModalHeaderSettings {} property StatusModalHeaderSettings header: StatusModalHeaderSettings {}
@ -18,6 +22,8 @@ QC.Popup {
property alias leftButtons: footerImpl.leftButtons property alias leftButtons: footerImpl.leftButtons
property bool showHeader: true property bool showHeader: true
property bool showFooter: true property bool showFooter: true
property bool showAdvancedHeader: false
property bool showAdvancedFooter: false
property alias hasCloseButton: headerImpl.hasCloseButton property alias hasCloseButton: headerImpl.hasCloseButton
signal editButtonClicked() signal editButtonClicked()
@ -64,11 +70,26 @@ QC.Popup {
onClose: statusModal.close() onClose: statusModal.close()
} }
Loader {
id: advancedHeader
anchors.top: parent.top
width: visible ? parent.width : 0
active: showAdvancedHeader
}
Spares.StatusModalFooter { Spares.StatusModalFooter {
id: footerImpl id: footerImpl
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: visible ? parent.width : 0 width: visible ? parent.width : 0
showFooter: statusModal.showFooter showFooter: statusModal.showFooter
} }
Loader {
id: advancedFooter
anchors.bottom: parent.bottom
width: visible ? parent.width : 0
active: showAdvancedFooter
}
} }
} }