Thread fetch more button

Changes threads so there is a button to fetch more events. Also adds a separator between the thread root and the rest of the events.
This commit is contained in:
James Graham
2025-01-25 16:50:29 +00:00
parent aca0669bf6
commit 37adb56233
8 changed files with 185 additions and 13 deletions

View File

@@ -2,8 +2,11 @@
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
import QtQuick
import QtQuick.Layouts
import Qt.labs.qmlmodels
import org.kde.kirigami as Kirigami
import org.kde.neochat
/**
@@ -54,6 +57,11 @@ DelegateChooser {
signal removeLinkPreview(int index)
/**
* @brief Request more events in the thread be loaded.
*/
signal fetchMoreEvents()
role: "componentType"
DelegateChoice {
@@ -218,6 +226,14 @@ DelegateChooser {
}
}
DelegateChoice {
roleValue: MessageComponentType.FetchButton
delegate: FetchButtonComponent {
maxContentWidth: root.maxContentWidth
onFetchMoreEvents: root.fetchMoreEvents()
}
}
DelegateChoice {
roleValue: MessageComponentType.Verification
delegate: MimeComponent {
@@ -233,6 +249,14 @@ DelegateChooser {
}
}
DelegateChoice {
roleValue: MessageComponentType.Separator
delegate: Kirigami.Separator {
Layout.fillWidth: true
Layout.maximumWidth: root.maxContentWidth
}
}
DelegateChoice {
roleValue: MessageComponentType.Other
delegate: Item {}