fix: fix suggested channels border and height

This commit is contained in:
Jonathan Rainville 2020-09-23 16:32:51 -04:00 committed by Iuri Matias
parent 99d5a46073
commit 024e7a18ae
2 changed files with 115 additions and 122 deletions

View File

@ -13,7 +13,7 @@ ScrollView {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
contentHeight: channelListContent.height contentHeight: channelListContent.height + Style.current.padding
clip: true clip: true
Item { Item {

View File

@ -7,31 +7,14 @@ import "../data/channelList.js" as ChannelJSON
import "../../../../shared" import "../../../../shared"
import "../../../../imports" import "../../../../imports"
Item { Rectangle {
id: emptyView id: emptyView
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
height: { height: suggestionContainer.height + inviteFriendsContainer.height + Style.current.padding * 2
if (!visible) return 0
var totalHeight = 0
for (let i = 0; i < sectionRepeater.count; i++) {
totalHeight += sectionRepeater.itemAt(i).height + Style.current.padding
}
return inviteFriendsContainer.height + totalHeight + Style.current.padding
}
Rectangle {
id: emptyViewContent
border.color: Style.current.border border.color: Style.current.border
radius: 16 radius: 16
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.top: parent.top
anchors.topMargin: Style.current.bigPadding
height: inviteFriendsContainer.height + suggestionContainer.height
color: Style.current.transparent color: Style.current.transparent
Item { Item {
@ -118,6 +101,17 @@ Item {
anchors.top: inviteFriendsContainer.bottom anchors.top: inviteFriendsContainer.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.rightMargin: Style.current.padding
height: {
if (!visible) return 0
var totalHeight = 0
for (let i = 0; i < sectionRepeater.count; i++) {
totalHeight += sectionRepeater.itemAt(i).height + Style.current.padding
}
return suggestionsText.height + totalHeight + Style.current.smallPadding
}
StyledText { StyledText {
id: suggestionsText id: suggestionsText
@ -148,7 +142,6 @@ Item {
} }
} }
} }
}
} }
/*##^## /*##^##