From c6893b0c7fe9757e049159d80663cce0af7f54e2 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Fri, 22 Oct 2021 18:12:48 +0200 Subject: [PATCH] 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. --- src/StatusQ/Layout/StatusAppNavBar.qml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/StatusQ/Layout/StatusAppNavBar.qml b/src/StatusQ/Layout/StatusAppNavBar.qml index 62c4ce9c..013a223f 100644 --- a/src/StatusQ/Layout/StatusAppNavBar.qml +++ b/src/StatusQ/Layout/StatusAppNavBar.qml @@ -21,6 +21,7 @@ Rectangle { property int communityTypeValue: -1 property int navBarButtonSpacing: 12 + property StatusNavBarTabButton navBarProfileButton property Component regularNavBarButton property Component communityNavBarButton @@ -30,6 +31,12 @@ Rectangle { signal aboutToUpdateFilteredRegularModel() signal aboutToUpdateFilteredCommunityModel() + onNavBarProfileButtonChanged: { + if (!!navBarProfileButton) { + navBarProfileButton.parent = navBarProfileButtonSlot + } + } + StatusAppNavBarFilterModel { id: navBarModel @@ -143,9 +150,21 @@ Rectangle { anchors.right: parent.right anchors.top: parent.top anchors.topMargin: 48 - anchors.bottom: parent.bottom + anchors.bottom: navBarProfileButtonSlot.top + anchors.bottomMargin: navBarButtonSpacing + spacing: navBarButtonSpacing 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 + } }