* Added functionality of customizable split headers * removed empty line
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user