diff --git a/src/qml/Component/Timeline/SectionDelegate.qml b/src/qml/Component/Timeline/SectionDelegate.qml index 98497b353..d2b0ffebb 100644 --- a/src/qml/Component/Timeline/SectionDelegate.qml +++ b/src/qml/Component/Timeline/SectionDelegate.qml @@ -19,6 +19,8 @@ QQC2.ItemDelegate { property int colorSet: Kirigami.Theme.Window topPadding: Kirigami.Units.largeSpacing + leftPadding: 0 + rightPadding: 0 bottomPadding: 0 // Note not 0 by default contentItem: ColumnLayout { diff --git a/src/qml/Component/Timeline/TimelineContainer.qml b/src/qml/Component/Timeline/TimelineContainer.qml index 5f5eb12e2..3c7710f0c 100644 --- a/src/qml/Component/Timeline/TimelineContainer.qml +++ b/src/qml/Component/Timeline/TimelineContainer.qml @@ -342,6 +342,8 @@ ColumnLayout { SectionDelegate { id: sectionDelegate Layout.fillWidth: true + // Fill ListView width without affecting size helper and the rest of components too much + Layout.rightMargin: root.parent ? root.width - root.parent.width : 0 visible: root.showSection labelText: root.section colorSet: Config.compactLayout || root.alwaysMaxWidth ? Kirigami.Theme.View : Kirigami.Theme.Window diff --git a/src/qml/Component/TimelineView.qml b/src/qml/Component/TimelineView.qml index 7b7ae044c..0c25a5d58 100644 --- a/src/qml/Component/TimelineView.qml +++ b/src/qml/Component/TimelineView.qml @@ -36,7 +36,7 @@ QQC2.ScrollView { readonly property NeoChatRoom currentRoom: root.currentRoom readonly property int largestVisibleIndex: count > 0 ? indexAt(contentX + (width / 2), contentY + height - 1) : -1 - readonly property var sectionBannerItem: contentHeight >= height ? itemAtIndex(sectionBannerIndex()) : undefined + readonly property Item sectionBannerItem: contentHeight >= height ? itemAtIndex(sectionBannerIndex()) : null // Spacing needs to be zero or the top sectionLabel overlay will be disrupted. // This is because itemAt returns null in the spaces. @@ -108,13 +108,11 @@ QQC2.ScrollView { footer: SectionDelegate { id: sectionBanner - anchors.left: parent.left - anchors.leftMargin: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.x : 0 - anchors.right: parent.right + width: ListView.view ? ListView.view.width : 0 maxWidth: Config.compactLayout ? messageListView.width : (messageListView.sectionBannerItem ? messageListView.sectionBannerItem.width - Kirigami.Units.largeSpacing * 2 : 0) z: 3 - visible: !!messageListView.sectionBannerItem && messageListView.sectionBannerItem.ListView.section !== "" && !Config.blur + visible: messageListView.sectionBannerItem && messageListView.sectionBannerItem.ListView.section !== "" && !Config.blur labelText: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.ListView.section : "" colorSet: Config.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window }