mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge pull request #1207 from 23rd/patch-35-empty-headers
Improved stream header creation.
This commit is contained in:
commit
246d24d616
|
@ -77,20 +77,15 @@ namespace {
|
||||||
}
|
}
|
||||||
auto formatTooltip(const TwitchChannel::StreamStatus &s)
|
auto formatTooltip(const TwitchChannel::StreamStatus &s)
|
||||||
{
|
{
|
||||||
return QStringList{"<style>.center { text-align: center; }</style>",
|
return QString("<style>.center { text-align: center; }</style> \
|
||||||
"<p class=\"center\">",
|
<p class=\"center\">%1%2%3%4%5 for %6 with %7 viewers</p>")
|
||||||
s.title.toHtmlEscaped(),
|
.arg(s.title.toHtmlEscaped())
|
||||||
"<br><br>",
|
.arg(s.title.isEmpty() ? QString() : "<br><br>")
|
||||||
s.game.toHtmlEscaped(),
|
.arg(s.game.toHtmlEscaped())
|
||||||
"<br>",
|
.arg(s.game.isEmpty() ? QString() : "<br>")
|
||||||
s.rerun ? "Vod-casting" : "Live",
|
.arg(s.rerun ? "Vod-casting" : "Live")
|
||||||
" for ",
|
.arg(s.uptime)
|
||||||
s.uptime,
|
.arg(QString::number(s.viewerCount));
|
||||||
" with ",
|
|
||||||
QString::number(s.viewerCount),
|
|
||||||
" viewers",
|
|
||||||
"</p>"}
|
|
||||||
.join("");
|
|
||||||
}
|
}
|
||||||
auto formatTitle(const TwitchChannel::StreamStatus &s, Settings &settings)
|
auto formatTitle(const TwitchChannel::StreamStatus &s, Settings &settings)
|
||||||
{
|
{
|
||||||
|
@ -109,9 +104,9 @@ namespace {
|
||||||
title += " - " + s.uptime;
|
title += " - " + s.uptime;
|
||||||
if (settings.headerViewerCount)
|
if (settings.headerViewerCount)
|
||||||
title += " - " + QString::number(s.viewerCount);
|
title += " - " + QString::number(s.viewerCount);
|
||||||
if (settings.headerGame)
|
if (settings.headerGame && !s.game.isEmpty())
|
||||||
title += " - " + s.game;
|
title += " - " + s.game;
|
||||||
if (settings.headerStreamTitle)
|
if (settings.headerStreamTitle && !s.title.isEmpty())
|
||||||
title += " - " + s.title;
|
title += " - " + s.title;
|
||||||
|
|
||||||
return title;
|
return title;
|
||||||
|
|
Loading…
Reference in a new issue