Live streams that are marked as reruns now mark a tab as yellow instead of red (#5176)

This commit is contained in:
Mm2PL
2024-02-18 17:22:53 +01:00
committed by GitHub
parent 641cb26a76
commit 5c51ec8382
9 changed files with 71 additions and 5 deletions
+26 -4
View File
@@ -327,6 +327,18 @@ void NotebookTab::setTabLocation(NotebookTabLocation location)
}
}
bool NotebookTab::setRerun(bool isRerun)
{
if (this->isRerun_ != isRerun)
{
this->isRerun_ = isRerun;
this->update();
return true;
}
return false;
}
bool NotebookTab::setLive(bool isLive)
{
if (this->isLive_ != isLive)
@@ -514,12 +526,22 @@ void NotebookTab::paintEvent(QPaintEvent *)
painter.fillRect(lineRect, lineColor);
// draw live indicator
if (this->isLive_ && getSettings()->showTabLive)
if ((this->isLive_ || this->isRerun_) && getSettings()->showTabLive)
{
painter.setPen(QColor(Qt::GlobalColor::red));
painter.setRenderHint(QPainter::Antialiasing);
// Live overrides rerun
QBrush b;
b.setColor(QColor(Qt::GlobalColor::red));
if (this->isLive_)
{
painter.setPen(QColor(Qt::GlobalColor::red));
b.setColor(QColor(Qt::GlobalColor::red));
}
else
{
painter.setPen(QColor(Qt::GlobalColor::yellow));
b.setColor(QColor(Qt::GlobalColor::yellow));
}
painter.setRenderHint(QPainter::Antialiasing);
b.setStyle(Qt::SolidPattern);
painter.setBrush(b);