Fix the top section heading in the timeline. It was previously causing anchor loops
This commit is contained in:
@@ -133,18 +133,39 @@ QQC2.ScrollView {
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: SectionDelegate {
|
footer: Item {
|
||||||
id: sectionBanner
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.contentItem.parent.x : 0
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
maxWidth: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.contentItem.width : 0
|
|
||||||
z: 3
|
z: 3
|
||||||
visible: !!messageListView.sectionBannerItem && messageListView.sectionBannerItem.ListView.section !== "" && !Config.blur
|
width: root.width
|
||||||
labelText: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.ListView.section : ""
|
visible: messageListView.sectionBannerItem && messageListView.sectionBannerItem.ListView.section !== "" && !Config.blur
|
||||||
colorSet: Config.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window
|
|
||||||
|
SectionDelegate {
|
||||||
|
id: sectionDelegate
|
||||||
|
anchors.leftMargin: state === "alignLeft" ? Kirigami.Units.largeSpacing : 0
|
||||||
|
state: Config.compactLayout ? "alignLeft" : "alignCenter"
|
||||||
|
// Align left when in compact mode and center when using bubbles
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "alignLeft"
|
||||||
|
AnchorChanges {
|
||||||
|
target: sectionDelegate
|
||||||
|
anchors.horizontalCenter: undefined
|
||||||
|
anchors.left: parent ? parent.left : undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "alignCenter"
|
||||||
|
AnchorChanges {
|
||||||
|
target: sectionDelegate
|
||||||
|
anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined
|
||||||
|
anchors.left: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
width: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.contentItem.width : 0
|
||||||
|
labelText: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.ListView.section : ""
|
||||||
|
colorSet: Config.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window
|
||||||
|
}
|
||||||
}
|
}
|
||||||
footerPositioning: ListView.OverlayHeader
|
footerPositioning: ListView.OverlayHeader
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user