fix(@desktop/activity): Fixed section glitch (#10576)

fixes #10472
This commit is contained in:
Cuteivist 2023-05-09 10:05:03 +02:00 committed by GitHub
parent 190e903921
commit 461f4a2bee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -138,6 +138,7 @@ ColumnLayout {
ScrollBar.vertical: StatusScrollBar {}
section.property: "date"
topMargin: -20 // Top margin for first section. Section cannot have different sizes
section.delegate: ColumnLayout {
id: sectionDelegate
@ -145,21 +146,23 @@ ColumnLayout {
width: ListView.view.width
// display always first section. Other sections when more items are being fetched must not be visible
visible: isFirstSection || section.length > 1
// 1 because we don't use empty for loading state
// Additionaly height must be defined so all sections use same height to to glitch sections when updating model
height: isFirstSection || section.length > 1 ? 58 : 0
visible: height > 0 // display always first section. Other sections when more items are being fetched must not be visible
spacing: 0
required property string section
Separator {
Layout.fillWidth: true
Layout.topMargin: sectionDelegate.isFirstSection ? 0 : 20
Layout.topMargin: 20
implicitHeight: 1
}
StatusTextWithLoadingState {
id: sectionText
Layout.topMargin: 12
Layout.alignment: Qt.AlignBottom
leftPadding: 16
bottomPadding: 8
text: loading ? "dummy" : parent.section // dummy text because loading component height depends on text height, and not visible with height == 0