From 2e1359c9e253b5fa128e892ab6f3f9905b0ce42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rich=CE=9Brd?= Date: Fri, 6 Aug 2021 12:47:57 -0400 Subject: [PATCH] fix(StatusAppNavBar): add profile button (#311) --- src/StatusQ/Layout/StatusAppNavBar.qml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/StatusQ/Layout/StatusAppNavBar.qml b/src/StatusQ/Layout/StatusAppNavBar.qml index 393ece0e..400583eb 100644 --- a/src/StatusQ/Layout/StatusAppNavBar.qml +++ b/src/StatusQ/Layout/StatusAppNavBar.qml @@ -10,6 +10,8 @@ Rectangle { id: statusAppNavBar property StatusNavBarTabButton navBarChatButton + property StatusNavBarTabButton navBarProfileButton + property list navBarTabButtons property alias navBarCommunityTabButtons: navBarCommunityTabButtons @@ -34,6 +36,12 @@ Rectangle { } } + onNavBarProfileButtonChanged: { + if (!!navBarProfileButton) { + navBarProfileButton.parent = navBarProfileButtonSlot + } + } + onNavBarTabButtonsChanged: { if (navBarTabButtons.length) { for (let idx in navBarTabButtons) { @@ -75,7 +83,9 @@ Rectangle { if (navBarContentHeight > statusAppNavBar.height) { height = statusAppNavBar.height - statusAppNavBar.navBarContentHeightWithoutCommunityButtons - - (!!navBarTabButtonsSlot.anchors.bottom ? navBarTabButtonsSlot.anchors.bottomMargin : navBarTabButtonsSlot.anchors.topMargin) + (!!navBarTabButtonsSlot.anchors.bottom ? navBarTabButtonsSlot.anchors.bottomMargin : navBarTabButtonsSlot.anchors.topMargin) - + navBarProfileButtonSlot.height - + navBarProfileButtonSlot.anchors.bottomMargin bottomPadding = 16 topPadding = 16 } else { @@ -122,7 +132,7 @@ Rectangle { if (navBarContentHeight > statusAppNavBar.height) { anchors.top = undefined anchors.topMargin = 0 - anchors.bottom = statusAppNavBar.bottom + anchors.bottom = navBarProfileButtonSlot.top anchors.bottomMargin = 32 } else { anchors.bottom = undefined @@ -132,5 +142,15 @@ Rectangle { } } } + + 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 + } }