fix(StatusAppNavBar): don't rely on `undefined` property

This turned out to be a bug. `model.count` isn't defined on `Repeater`
types.

Also, set `ScrollView` height to `0` if there are not community
tab buttons. This is needed because the columns implicit height
comes with spacing, resulting in some height.
This commit is contained in:
Pascal Precht 2021-06-11 12:22:47 +02:00 committed by Pascal Precht
parent 1f3aa0bbd5
commit 175d7a195c
1 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ Rectangle {
bottomPadding = 16 bottomPadding = 16
topPadding = 16 topPadding = 16
} else { } else {
height = navBarCommunityTabButtonsSlot.implicitHeight height = navBarCommunityTabButtons.count > 0 ? navBarCommunityTabButtonsSlot.implicitHeight : 0
} }
} }
@ -107,7 +107,7 @@ Rectangle {
height: 1 height: 1
width: 30 width: 30
color: Theme.palette.directColor7 color: Theme.palette.directColor7
anchors.top: navBarCommunityTabButtons.model && navBarCommunityTabButtons.model.count > 0 ? navBarScrollSection.bottom : navBarChatButtonSlot.bottom anchors.top: !!navBarCommunityTabButtons.model && navBarCommunityTabButtons.count > 0 ? navBarScrollSection.bottom : navBarChatButtonSlot.bottom
anchors.topMargin: navBarScrollSection.height < navBarCommunityTabButtonsSlot.implicitHeight ? 0 : 16 anchors.topMargin: navBarScrollSection.height < navBarCommunityTabButtonsSlot.implicitHeight ? 0 : 16
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
visible: navBarChatButton !== null && navBarTabButtons.length > 0 visible: navBarChatButton !== null && navBarTabButtons.length > 0