mirror of https://github.com/KDE/kasts.git
Also show left duration on EntryDelegates if it's been set in the player
This commit is contained in:
parent
9621919310
commit
35cfb14e1f
|
@ -363,6 +363,11 @@ QString Enclosure::formattedDuration() const
|
|||
return m_kformat.formatDuration(m_duration * 1000);
|
||||
}
|
||||
|
||||
QString Enclosure::formattedLeftDuration() const
|
||||
{
|
||||
return m_kformat.formatDuration(duration() * 1000 - playPosition());
|
||||
}
|
||||
|
||||
QString Enclosure::formattedPlayPosition() const
|
||||
{
|
||||
return m_kformat.formatDuration(m_playposition);
|
||||
|
|
|
@ -32,6 +32,7 @@ class Enclosure : public QObject
|
|||
Q_PROPERTY(QString formattedDownloadSize READ formattedDownloadSize NOTIFY downloadProgressChanged)
|
||||
Q_PROPERTY(QString path READ path CONSTANT)
|
||||
Q_PROPERTY(qint64 playPosition READ playPosition WRITE setPlayPosition NOTIFY playPositionChanged)
|
||||
Q_PROPERTY(QString formattedLeftDuration READ formattedLeftDuration NOTIFY playPositionChanged)
|
||||
Q_PROPERTY(QString formattedPlayPosition READ formattedPlayPosition NOTIFY playPositionChanged);
|
||||
Q_PROPERTY(qint64 duration READ duration WRITE setDuration NOTIFY durationChanged)
|
||||
Q_PROPERTY(QString formattedDuration READ formattedDuration NOTIFY durationChanged)
|
||||
|
@ -62,6 +63,7 @@ public:
|
|||
qint64 sizeOnDisk() const;
|
||||
QString formattedSize() const;
|
||||
QString formattedDuration() const;
|
||||
QString formattedLeftDuration() const;
|
||||
QString formattedPlayPosition() const;
|
||||
QString formattedDownloadSize() const;
|
||||
|
||||
|
|
|
@ -159,7 +159,9 @@ Kirigami.SwipeListItem {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
Controls.Label {
|
||||
text: entry.enclosure.formattedDuration
|
||||
text: (SettingsManager.toggleRemainingTime)
|
||||
? "-" + entry.enclosure.formattedLeftDuration
|
||||
: entry.enclosure.formattedDuration
|
||||
elide: Text.ElideRight
|
||||
font: Kirigami.Theme.smallFont
|
||||
opacity: 0.7
|
||||
|
|
Loading…
Reference in New Issue