diff --git a/docroot/css/lms.css b/docroot/css/lms.css index d96843c5..3fecc982 100644 --- a/docroot/css/lms.css +++ b/docroot/css/lms.css @@ -142,6 +142,10 @@ a.Lms-artistname:hover, a.Lms-artistname:focus { margin-bottom: 25px; } +.Lms-explore-entry-grid-text-container { + height: 36px; +} + .Lms-explore-entry-grid-text-container h5, h6 { margin-top: 6px; margin-bottom: 6px; diff --git a/src/libs/database/impl/Artist.cpp b/src/libs/database/impl/Artist.cpp index f9be47a0..7f2302f7 100644 --- a/src/libs/database/impl/Artist.cpp +++ b/src/libs/database/impl/Artist.cpp @@ -395,7 +395,7 @@ Artist::getTracks(std::optional linkType) const auto query {session()->query>("SELECT DISTINCT t FROM track t INNER JOIN artist a ON a.id = t_a_l.artist_id INNER JOIN track_artist_link t_a_l ON t_a_l.track_id = t.id") .where("a.id = ?").bind(self()->id()) - .orderBy("t.year,t.release_id,t.disc_number,t.track_number")}; + .orderBy("t.year DESC,t.release_id,t.disc_number,t.track_number")}; if (linkType) query.where("t_a_l.type = ?").bind(*linkType); diff --git a/src/lms/ui/LmsApplication.cpp b/src/lms/ui/LmsApplication.cpp index 0624e917..89cebb24 100644 --- a/src/lms/ui/LmsApplication.cpp +++ b/src/lms/ui/LmsApplication.cpp @@ -427,6 +427,7 @@ LmsApplication::createHome() _audioFileResource = std::make_shared(); declareJavaScriptFunction("onLoadCover", "function(id) { id.className += \" Lms-cover-loaded\"}"); + doJavaScript("$('body').tooltip({ selector: '[data-toggle=\"tooltip\"]'})"); Wt::WTemplate* main {root()->addWidget(std::make_unique(Wt::WString::tr("Lms.template")))}; diff --git a/src/lms/ui/PlayQueue.cpp b/src/lms/ui/PlayQueue.cpp index 6f9f0303..04a895b7 100644 --- a/src/lms/ui/PlayQueue.cpp +++ b/src/lms/ui/PlayQueue.cpp @@ -50,8 +50,15 @@ PlayQueue::PlayQueue() _radioMode = LmsApp->getUser()->isRadioSet(); } + auto setToolTip = [](Wt::WWidget& widget, Wt::WString title) + { + widget.setAttributeValue("data-toggle", "tooltip"); + widget.setAttributeValue("data-placement", "bottom"); + widget.setAttributeValue("title", std::move(title)); + }; + Wt::WText* clearBtn = bindNew("clear-btn", Wt::WString::tr("Lms.PlayQueue.template.clear-btn"), Wt::TextFormat::XHTML); - clearBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.clear")); + setToolTip(*clearBtn, Wt::WString::tr("Lms.PlayQueue.clear")); clearBtn->clicked().connect([=] { clearTracks(); @@ -68,7 +75,7 @@ PlayQueue::PlayQueue() }); Wt::WText* shuffleBtn = bindNew("shuffle-btn", Wt::WString::tr("Lms.PlayQueue.template.shuffle-btn"), Wt::TextFormat::XHTML); - shuffleBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.shuffle")); + setToolTip(*shuffleBtn, Wt::WString::tr("Lms.PlayQueue.shuffle")); shuffleBtn->clicked().connect([=] { { @@ -87,7 +94,7 @@ PlayQueue::PlayQueue() }); _repeatBtn = bindNew("repeat-btn", Wt::WString::tr("Lms.PlayQueue.template.repeat-btn"), Wt::TextFormat::XHTML); - _repeatBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.repeat")); + setToolTip(*_repeatBtn, Wt::WString::tr("Lms.PlayQueue.repeat")); _repeatBtn->clicked().connect([=] { _repeatAll = !_repeatAll; @@ -101,7 +108,7 @@ PlayQueue::PlayQueue() updateRepeatBtn(); _radioBtn = bindNew("radio-btn", Wt::WString::tr("Lms.PlayQueue.template.radio-btn")); - _radioBtn->setToolTip(Wt::WString::tr("Lms.PlayQueue.radio-mode")); + setToolTip(*_radioBtn, Wt::WString::tr("Lms.PlayQueue.radio-mode")); _radioBtn->clicked().connect([=] { _radioMode = !_radioMode; diff --git a/src/lms/ui/explore/TrackListHelpers.cpp b/src/lms/ui/explore/TrackListHelpers.cpp index 72c225ce..3d4ec648 100644 --- a/src/lms/ui/explore/TrackListHelpers.cpp +++ b/src/lms/ui/explore/TrackListHelpers.cpp @@ -83,6 +83,7 @@ namespace UserInterface::TrackListHelpers auto cover = entry->bindNew("cover"); cover->setImageLink(LmsApp->getImageResource()->getTrackUrl(trackId, ImageResource::Size::Large)); cover->setStyleClass("Lms-cover"); + cover->setAttributeValue("onload", LmsApp->javaScriptClass() + ".onLoadCover(this)"); } entry->bindString("duration", trackDurationToString(track->getDuration()), Wt::TextFormat::Plain); @@ -106,8 +107,7 @@ namespace UserInterface::TrackListHelpers if (auto trackIdLoaded {LmsApp->getMediaPlayer().getTrackLoaded()}) { - if (*trackIdLoaded == trackId) - entry->bindString("is-playing", "Lms-entry-playing"); + entry->bindString("is-playing", *trackIdLoaded == trackId ? "Lms-entry-playing" : ""); } else entry->bindString("is-playing", "");