Store the "showing latest messages" in a variable for later use

This commit is contained in:
Rasmus Karlsson 2017-06-06 17:22:16 +02:00
parent 814fc4bbae
commit edcea52cc6
2 changed files with 5 additions and 4 deletions

View file

@ -63,10 +63,7 @@ bool ChatWidgetView::layoutMessages()
// True if one of the following statements are true:
// The scrollbar was not visible
// The scrollbar was visible and at the bottom
bool showingLatestMessages = false;
if (this->_scrollbar.isAtBottom() || !this->_scrollbar.isVisible()) {
showingLatestMessages = true;
}
this->showingLatestMessages = this->_scrollbar.isAtBottom() || !this->_scrollbar.isVisible();
int start = _scrollbar.getCurrentValue();
int layoutWidth = _scrollbar.isVisible() ? width() - _scrollbar.width() : width();

View file

@ -52,6 +52,10 @@ private:
ScrollBar _scrollbar;
// This variable can be used to decide whether or not we should render the "Show latest
// messages" button
bool showingLatestMessages = true;
AccountPopupWidget _userPopupWidget;
bool _onlyUpdateEmotes;