Compare commits

...
Author SHA1 Message Date
ivan tkachenko 5381c97999 Timeline: Stretch date section sections across the whole ListView width
With paddings, it looked sort of glitched, especially in RTL layouts,
because messages from the top were highlighting all around the padded
section delegate.
2023-09-13 13:05:07 +00:00
3 changed files with 7 additions and 5 deletions

No files matched your search

@@ -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 {
@@ -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
+3 -5
View File
@@ -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
}