fix(StatusAppNavBar): add profile button (#311)
This commit is contained in:
parent
aab59763e5
commit
2e1359c9e2
|
@ -10,6 +10,8 @@ Rectangle {
|
|||
id: statusAppNavBar
|
||||
|
||||
property StatusNavBarTabButton navBarChatButton
|
||||
property StatusNavBarTabButton navBarProfileButton
|
||||
|
||||
property list<StatusNavBarTabButton> 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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue