refactor(StatusAppNavBar): profile nav bar button added

Profile button of type `StatusNavBarTabButton` added to `StatusAppNavBar`
and exposed so it can be optionally set from outside of the component.
This commit is contained in:
Sale Djenic 2021-10-22 18:12:48 +02:00 committed by saledjenic
parent 2ee91475e5
commit c6893b0c7f
1 changed files with 20 additions and 1 deletions

View File

@ -21,6 +21,7 @@ Rectangle {
property int communityTypeValue: -1 property int communityTypeValue: -1
property int navBarButtonSpacing: 12 property int navBarButtonSpacing: 12
property StatusNavBarTabButton navBarProfileButton
property Component regularNavBarButton property Component regularNavBarButton
property Component communityNavBarButton property Component communityNavBarButton
@ -30,6 +31,12 @@ Rectangle {
signal aboutToUpdateFilteredRegularModel() signal aboutToUpdateFilteredRegularModel()
signal aboutToUpdateFilteredCommunityModel() signal aboutToUpdateFilteredCommunityModel()
onNavBarProfileButtonChanged: {
if (!!navBarProfileButton) {
navBarProfileButton.parent = navBarProfileButtonSlot
}
}
StatusAppNavBarFilterModel { StatusAppNavBarFilterModel {
id: navBarModel id: navBarModel
@ -143,9 +150,21 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 48 anchors.topMargin: 48
anchors.bottom: parent.bottom anchors.bottom: navBarProfileButtonSlot.top
anchors.bottomMargin: navBarButtonSpacing
spacing: navBarButtonSpacing spacing: navBarButtonSpacing
model: navBarModel model: navBarModel
} }
Item {
id: navBarProfileButtonSlot
anchors.horizontalCenter: parent.horizontalCenter
height: visible? statusAppNavBar.navBarProfileButton.height : 0
width: visible? statusAppNavBar.navBarProfileButton.width : 0
visible: !!statusAppNavBar.navBarProfileButton
anchors.bottom: parent.bottom
anchors.bottomMargin: visible ? 32 : 0
}
} }