mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fixes #963 Highlights move while paused
This commit is contained in:
parent
fd8987cf1b
commit
602a66f5bc
|
@ -241,6 +241,14 @@ void ChannelView::unpause(PauseReason reason)
|
|||
this->pauses_.erase(reason);
|
||||
|
||||
this->updatePauseTimer();
|
||||
|
||||
/// Move selection
|
||||
this->selection_.selectionMin.messageIndex -= this->pauseSelectionOffset_;
|
||||
this->selection_.selectionMax.messageIndex -= this->pauseSelectionOffset_;
|
||||
this->selection_.start.messageIndex -= this->pauseSelectionOffset_;
|
||||
this->selection_.end.messageIndex -= this->pauseSelectionOffset_;
|
||||
|
||||
this->pauseSelectionOffset_ = 0;
|
||||
}
|
||||
|
||||
void ChannelView::updatePauseTimer()
|
||||
|
@ -697,10 +705,17 @@ void ChannelView::messageAddedAtStart(std::vector<MessagePtr> &messages)
|
|||
|
||||
void ChannelView::messageRemoveFromStart(MessagePtr &message)
|
||||
{
|
||||
this->selection_.selectionMin.messageIndex--;
|
||||
this->selection_.selectionMax.messageIndex--;
|
||||
this->selection_.start.messageIndex--;
|
||||
this->selection_.end.messageIndex--;
|
||||
if (this->paused())
|
||||
{
|
||||
this->pauseSelectionOffset_ += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->selection_.selectionMin.messageIndex--;
|
||||
this->selection_.selectionMax.messageIndex--;
|
||||
this->selection_.start.messageIndex--;
|
||||
this->selection_.end.messageIndex--;
|
||||
}
|
||||
|
||||
this->queueLayout();
|
||||
}
|
||||
|
|
|
@ -163,6 +163,7 @@ private:
|
|||
pauses_;
|
||||
boost::optional<SteadyClock::time_point> pauseEnd_;
|
||||
int pauseScrollOffset_ = 0;
|
||||
int pauseSelectionOffset_ = 0;
|
||||
|
||||
boost::optional<MessageElementFlags> overrideFlags_;
|
||||
MessageLayoutPtr lastReadMessage_;
|
||||
|
|
Loading…
Reference in a new issue