Port away from BasicListItem

For ChapterListDelegate
This commit is contained in:
Alexey Andreyev 2023-09-27 02:04:19 +03:00
parent ad96d5a80f
commit 735a879cce

View File

@ -9,12 +9,13 @@ import QtQuick.Controls as Controls
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.delegates as Delegates
import org.kde.kmediasession
import org.kde.kasts
Kirigami.BasicListItem {
Delegates.RoundedItemDelegate {
id: root
property var entry: undefined
@ -23,17 +24,14 @@ Kirigami.BasicListItem {
property bool streamingButtonVisible: entry != undefined && entry.enclosure && (entry.enclosure.status !== Enclosure.Downloaded) && NetworkConnectionManager.streamingAllowed && (SettingsManager.prioritizeStreaming || AudioManager.entry === entry)
text: model.title
icon.source: model.chapter.cachedImage
contentItem: RowLayout {
Delegates.SubtitleContentItem {
itemDelegate: root
subtitle: model.formattedStart
separatorVisible: true
leading: ImageWithFallback {
imageSource: model.chapter.cachedImage
height: parent.height
width: height
fractionalRadius: 1.0 / 8.0
}
trailing: Controls.ToolButton {
Controls.ToolButton {
icon.name: streamingButtonVisible ? "media-playback-cloud" : "media-playback-start"
text: i18n("Play")
enabled: entry != undefined && entry.enclosure && (entry.enclosure.status === Enclosure.Downloaded || streamingButtonVisible)
@ -54,4 +52,5 @@ Kirigami.BasicListItem {
}
}
}
}
}