feat: show track title and artist on separate lines in toolbar

Title shown in semi-bold, artist below in smaller grey text — matching
the previous two-line style the user preferred.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
joren
2026-03-24 10:29:31 +01:00
parent 15ba6f7a1e
commit c4c3b2c19d

View File

@@ -31,6 +31,7 @@ MainToolBar::MainToolBar(QobuzBackend *backend, PlayQueue *queue, QWidget *paren
m_trackLabel->setMinimumWidth(80); m_trackLabel->setMinimumWidth(80);
m_trackLabel->setMaximumWidth(200); m_trackLabel->setMaximumWidth(200);
m_trackLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); m_trackLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
m_trackLabel->setTextFormat(Qt::RichText);
addWidget(m_trackLabel); addWidget(m_trackLabel);
addSeparator(); addSeparator();
@@ -132,9 +133,11 @@ void MainToolBar::setCurrentTrack(const QJsonObject &track)
if (title.isEmpty()) { if (title.isEmpty()) {
m_trackLabel->setText(tr("Not playing")); m_trackLabel->setText(tr("Not playing"));
} else if (artist.isEmpty()) { } else if (artist.isEmpty()) {
m_trackLabel->setText(title); m_trackLabel->setText(title.toHtmlEscaped());
} else { } else {
m_trackLabel->setText(QStringLiteral("%1 — %2").arg(title, artist)); m_trackLabel->setText(QStringLiteral("<span style='font-weight:600;'>%1</span>"
"<br><span style='font-size:small; color:#aaa;'>%2</span>")
.arg(title.toHtmlEscaped(), artist.toHtmlEscaped()));
} }
const QString artUrl = track["album"].toObject()["image"].toObject()["small"].toString(); const QString artUrl = track["album"].toObject()["image"].toObject()["small"].toString();