mirror of
https://github.com/KDE/kasts.git
synced 2025-01-22 21:30:43 +01:00
Port away from BasicListItem
For ChapterListDelegate
This commit is contained in:
parent
ad96d5a80f
commit
735a879cce
@ -9,12 +9,13 @@ import QtQuick.Controls as Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
|
import org.kde.kirigamiaddons.delegates as Delegates
|
||||||
import org.kde.kmediasession
|
import org.kde.kmediasession
|
||||||
|
|
||||||
import org.kde.kasts
|
import org.kde.kasts
|
||||||
|
|
||||||
|
|
||||||
Kirigami.BasicListItem {
|
Delegates.RoundedItemDelegate {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property var entry: undefined
|
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)
|
property bool streamingButtonVisible: entry != undefined && entry.enclosure && (entry.enclosure.status !== Enclosure.Downloaded) && NetworkConnectionManager.streamingAllowed && (SettingsManager.prioritizeStreaming || AudioManager.entry === entry)
|
||||||
|
|
||||||
text: model.title
|
text: model.title
|
||||||
|
icon.source: model.chapter.cachedImage
|
||||||
|
|
||||||
|
contentItem: RowLayout {
|
||||||
|
Delegates.SubtitleContentItem {
|
||||||
|
itemDelegate: root
|
||||||
subtitle: model.formattedStart
|
subtitle: model.formattedStart
|
||||||
separatorVisible: true
|
|
||||||
|
|
||||||
leading: ImageWithFallback {
|
|
||||||
imageSource: model.chapter.cachedImage
|
|
||||||
height: parent.height
|
|
||||||
width: height
|
|
||||||
fractionalRadius: 1.0 / 8.0
|
|
||||||
}
|
}
|
||||||
|
Controls.ToolButton {
|
||||||
trailing: Controls.ToolButton {
|
|
||||||
icon.name: streamingButtonVisible ? "media-playback-cloud" : "media-playback-start"
|
icon.name: streamingButtonVisible ? "media-playback-cloud" : "media-playback-start"
|
||||||
text: i18n("Play")
|
text: i18n("Play")
|
||||||
enabled: entry != undefined && entry.enclosure && (entry.enclosure.status === Enclosure.Downloaded || streamingButtonVisible)
|
enabled: entry != undefined && entry.enclosure && (entry.enclosure.status === Enclosure.Downloaded || streamingButtonVisible)
|
||||||
@ -54,4 +52,5 @@ Kirigami.BasicListItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user