Switch section delegate for standard Kirigami.ListSectionHeader

Switch section delegate for standard Kirigami.ListSectionHeader, SectionDelegate is no longer required so removed.
This commit is contained in:
James Graham
2025-06-20 07:42:14 +01:00
parent f026414b1a
commit e2daa091e8
4 changed files with 6 additions and 63 deletions

View File

@@ -19,7 +19,6 @@ ecm_add_qml_module(Timeline GENERATE_PLUGIN_SOURCE
TimelineEndDelegate.qml
Bubble.qml
AvatarFlow.qml
SectionDelegate.qml
QuickActions.qml
TypingPane.qml
BaseMessageComponentChooser.qml

View File

@@ -201,10 +201,9 @@ MessageDelegateBase {
}
}
sectionComponent: SectionDelegate {
id: sectionDelegate
labelText: root.section
colorSet: root.compactMode ? Kirigami.Theme.View : Kirigami.Theme.Window
sectionComponent: Kirigami.ListSectionHeader {
horizontalPadding: 0
text: root.section
}
readMarkerComponent: AvatarFlow {

View File

@@ -1,55 +0,0 @@
// SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: GPL-3.0-only
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.neochat
QQC2.ItemDelegate {
id: root
property alias labelText: sectionLabel.text
property var maxWidth: Number.POSITIVE_INFINITY
property int colorSet: Kirigami.Theme.Window
leftPadding: 0
rightPadding: 0
topPadding: Kirigami.Units.largeSpacing
bottomPadding: 0 // Note not 0 by default
leftInset: 0
rightInset: 0
topInset: -1 // This -1 is intentional to stretch the background one more pixel to prevent a visual bug when scrolling
bottomInset: 0
contentItem: ColumnLayout {
spacing: Kirigami.Units.smallSpacing
Layout.fillWidth: true
Kirigami.Heading {
id: sectionLabel
level: 4
color: Kirigami.Theme.disabledTextColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Layout.fillWidth: true
Layout.maximumWidth: maxWidth
}
Kirigami.Separator {
Layout.fillWidth: true
Layout.maximumWidth: maxWidth
}
}
background: Rectangle {
color: NeoChatConfig.blur ? "transparent" : Kirigami.Theme.backgroundColor
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: root.colorSet
}
}

View File

@@ -69,11 +69,11 @@ TimelineDelegate {
alwaysFillWidth: NeoChatConfig.compactLayout
contentItem: ColumnLayout {
SectionDelegate {
Kirigami.ListSectionHeader {
Layout.fillWidth: true
visible: root.showSection
labelText: root.section
colorSet: NeoChatConfig.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window
horizontalPadding: 0
text: root.section
}
RowLayout {
Layout.fillWidth: true