Added functionality of customizable split headers #637 (#648)

* Added functionality of customizable split headers

* removed empty line
This commit is contained in:
apa420
2018-08-06 16:42:23 +02:00
committed by fourtf
parent c6cfb548f5
commit 43ba408568
4 changed files with 44 additions and 1 deletions
+26
View File
@@ -101,6 +101,20 @@ SplitHeader::SplitHeader(Split *_split)
this->addModeActions(this->modeMenu_);
this->setMouseTracking(true);
// Update title on title-settings-change
getSettings()->showViewerCount.connect(
[this](const auto &, const auto &) { this->updateChannelText(); },
this->managedConnections_);
getSettings()->showTitle.connect(
[this](const auto &, const auto &) { this->updateChannelText(); },
this->managedConnections_);
getSettings()->showGame.connect(
[this](const auto &, const auto &) { this->updateChannelText(); },
this->managedConnections_);
getSettings()->showUptime.connect(
[this](const auto &, const auto &) { this->updateChannelText(); },
this->managedConnections_);
}
SplitHeader::~SplitHeader()
@@ -331,6 +345,18 @@ void SplitHeader::updateChannelText()
} else {
title += " (live)";
}
if (getSettings()->showViewerCount) {
title += " - " + QString::number(streamStatus->viewerCount) + " viewers";
}
if (getSettings()->showTitle) {
title += " - " + streamStatus->title;
}
if (getSettings()->showGame) {
title += " - " + streamStatus->game;
}
if (getSettings()->showUptime) {
title += " - uptime: " + streamStatus->uptime;
}
} else {
this->tooltip_ = QString();
}