Added a currently playing indicator in the tracks view
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@
|
||||
</message>
|
||||
|
||||
<message id="Lms.Explore.Tracks.template.entry">
|
||||
<div class="row Lms-explore-tracks-entry Lms-entry-hoverable Lms-vertical-align">
|
||||
<div class="row Lms-explore-tracks-entry Lms-entry-hoverable Lms-vertical-align ${is-playing}">
|
||||
<div class="col-xs-9 Lms-explore-tracks-entry-name">
|
||||
<h4><div class="Lms-trackname text-primary">${name}</div></h4>
|
||||
${<if-has-artists-or-release>}
|
||||
|
||||
+6
-6
@@ -136,6 +136,12 @@ a.Lms-artistname:hover, a.Lms-artistname:focus {
|
||||
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.Lms-entry-playing {
|
||||
font-weight: bold;
|
||||
border-radius: 3px;
|
||||
background-color: var(--playing-background-color);
|
||||
}
|
||||
|
||||
.Lms-explore-contents {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
@@ -177,12 +183,6 @@ a.Lms-artistname:hover, a.Lms-artistname:focus {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.Lms-explore-release-entry-playing {
|
||||
font-weight: bold;
|
||||
border-radius: 3px;
|
||||
background-color: var(--playing-background-color);
|
||||
}
|
||||
|
||||
.Lms-explore-release-entry-track-duration {
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -212,12 +212,12 @@ Release::refresh()
|
||||
|
||||
LmsApp->getEvents().trackLoaded.connect(entry, [=] (Database::IdType loadedTrackId, bool /*play*/)
|
||||
{
|
||||
entry->bindString("is-playing", loadedTrackId == trackId ? "Lms-explore-release-entry-playing" : "");
|
||||
entry->bindString("is-playing", loadedTrackId == trackId ? "Lms-entry-playing" : "");
|
||||
});
|
||||
|
||||
if (LmsApp->getEvents().lastLoadedTrackId && *LmsApp->getEvents().lastLoadedTrackId == trackId)
|
||||
{
|
||||
entry->bindString("is-playing", "Lms-explore-release-entry-playing");
|
||||
entry->bindString("is-playing", "Lms-entry-playing");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,17 @@ Tracks::addSome()
|
||||
{
|
||||
tracksAdd.emit({trackId});
|
||||
}));
|
||||
|
||||
|
||||
LmsApp->getEvents().trackLoaded.connect(entry, [=] (Database::IdType loadedTrackId, bool /*play*/)
|
||||
{
|
||||
entry->bindString("is-playing", loadedTrackId == trackId ? "Lms-entry-playing" : "");
|
||||
});
|
||||
|
||||
if (LmsApp->getEvents().lastLoadedTrackId && *LmsApp->getEvents().lastLoadedTrackId == trackId)
|
||||
{
|
||||
entry->bindString("is-playing", "Lms-entry-playing");
|
||||
}
|
||||
}
|
||||
|
||||
_showMore->setHidden(!moreResults);
|
||||
|
||||
Reference in New Issue
Block a user