mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
add more highlight state functions
This commit is contained in:
parent
8745d0740f
commit
39e0e00f2d
|
@ -444,9 +444,43 @@ bool NotebookTab::isLive() const
|
|||
return this->isLive_;
|
||||
}
|
||||
|
||||
void NotebookTab::setHighlightState(HighlightState newHighlightStyle,
|
||||
const ChannelView &channelViewSource,
|
||||
const MessagePtr &message)
|
||||
HighlightState NotebookTab::highlightState() const
|
||||
{
|
||||
return this->highlightState_;
|
||||
}
|
||||
|
||||
void NotebookTab::setHighlightState(HighlightState newHighlightStyle)
|
||||
{
|
||||
if (this->isSelected())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this->highlightEnabled_ &&
|
||||
newHighlightStyle == HighlightState::NewMessage)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->highlightState_ == newHighlightStyle ||
|
||||
this->highlightState_ == HighlightState::Highlighted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->highlightState_ = newHighlightStyle;
|
||||
this->update();
|
||||
}
|
||||
|
||||
void NotebookTab::forceHighlightState(HighlightState newHighlightStyle)
|
||||
{
|
||||
this->highlightState_ = newHighlightStyle;
|
||||
this->update();
|
||||
}
|
||||
|
||||
void NotebookTab::updateHighlightState(HighlightState newHighlightStyle,
|
||||
const ChannelView &channelViewSource,
|
||||
const MessagePtr &message)
|
||||
{
|
||||
if (this->isSelected())
|
||||
{
|
||||
|
|
|
@ -60,12 +60,30 @@ public:
|
|||
**/
|
||||
bool isLive() const;
|
||||
|
||||
void setHighlightState(HighlightState style,
|
||||
const ChannelView &channelViewSource,
|
||||
const MessagePtr &message);
|
||||
/**
|
||||
* @brief Sets the highlight state of this tab clearing out highlight sources
|
||||
*
|
||||
* Obeys the HighlightsEnabled setting and highlight states hierarchy
|
||||
*/
|
||||
void setHighlightState(HighlightState style);
|
||||
/**
|
||||
* @brief Forces the highlight state of this tab
|
||||
*
|
||||
* Does NOT obey the HighlightsEnabled setting and the highlight states hierarchy
|
||||
*/
|
||||
void forceHighlightState(HighlightState style);
|
||||
/**
|
||||
* @brief Updates the highlight state and highlight sources of this tab
|
||||
*
|
||||
* Obeys the HighlightsEnabled setting and the highlight state hierarchy and tracks the highlight state update sources
|
||||
*/
|
||||
void updateHighlightState(HighlightState style,
|
||||
const ChannelView &channelViewSource,
|
||||
const MessagePtr &message);
|
||||
void copyHighlightStateAndSourcesFrom(const NotebookTab *sourceTab);
|
||||
void setHighlightsEnabled(const bool &newVal);
|
||||
bool hasHighlightsEnabled() const;
|
||||
HighlightState highlightState() const;
|
||||
|
||||
void moveAnimated(QPoint targetPos, bool animated = true);
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ void SplitContainer::addSplit(Split *split)
|
|||
HighlightState state, const MessagePtr &message) {
|
||||
if (this->tab_ != nullptr)
|
||||
{
|
||||
this->tab_->setHighlightState(
|
||||
this->tab_->updateHighlightState(
|
||||
state, channelView, message);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue