Add setting to only show tabs with live channels (#4358)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Daniel Sage
2023-06-11 02:34:28 -07:00
committed by GitHub
parent c907f2b170
commit 4361790fbd
13 changed files with 412 additions and 136 deletions
+2 -2
View File
@@ -211,12 +211,12 @@ void NotebookButton::dropEvent(QDropEvent *event)
void NotebookButton::hideEvent(QHideEvent *)
{
this->parent_->performLayout();
this->parent_->refresh();
}
void NotebookButton::showEvent(QShowEvent *)
{
this->parent_->performLayout();
this->parent_->refresh();
}
} // namespace chatterino
+11 -3
View File
@@ -234,7 +234,7 @@ void NotebookTab::updateSize()
if (this->width() != width || this->height() != height)
{
this->resize(width, height);
this->notebook_->performLayout();
this->notebook_->refresh();
}
}
@@ -290,7 +290,7 @@ void NotebookTab::titleUpdated()
{
// Queue up save because: Tab title changed
getApp()->windows->queueSave();
this->notebook_->performLayout();
this->notebook_->refresh();
this->updateSize();
this->update();
}
@@ -327,13 +327,21 @@ void NotebookTab::setTabLocation(NotebookTabLocation location)
}
}
void NotebookTab::setLive(bool isLive)
bool NotebookTab::setLive(bool isLive)
{
if (this->isLive_ != isLive)
{
this->isLive_ = isLive;
this->update();
return true;
}
return false;
}
bool NotebookTab::isLive() const
{
return this->isLive_;
}
void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
+12 -1
View File
@@ -40,7 +40,18 @@ public:
void setInLastRow(bool value);
void setTabLocation(NotebookTabLocation location);
void setLive(bool isLive);
/**
* @brief Sets the live status of this tab
*
* Returns true if the live status was changed, false if nothing changed.
**/
bool setLive(bool isLive);
/**
* @brief Returns true if any split in this tab is live
**/
bool isLive() const;
void setHighlightState(HighlightState style);
void setHighlightsEnabled(const bool &newVal);
bool hasHighlightsEnabled() const;