Rework delegates to use latest kirigami(-addons) features

This commit is contained in:
Bart De Vries 2023-09-27 13:33:40 +02:00
parent af0616e71a
commit a46ab103af

View File

@ -9,13 +9,14 @@ import QtQuick.Controls as Controls
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.delegates as Delegates
import org.kde.kirigami.delegates as Delegates
import org.kde.kirigamiaddons.delegates as AddonDelegates
import org.kde.kmediasession
import org.kde.kasts
Delegates.RoundedItemDelegate {
AddonDelegates.RoundedItemDelegate {
id: root
property var entry: undefined
@ -23,14 +24,14 @@ Delegates.RoundedItemDelegate {
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
Delegates.IconTitleSubtitle {
icon.source: model.chapter.cachedImage
title: model.title
subtitle: model.formattedStart
Layout.fillWidth: true
}
Controls.ToolButton {
icon.name: streamingButtonVisible ? "media-playback-cloud" : "media-playback-start"
text: i18n("Play")