diff --git a/src/widgets/chatwidgetview.cpp b/src/widgets/chatwidgetview.cpp index 10b41ef1..dcc7377a 100644 --- a/src/widgets/chatwidgetview.cpp +++ b/src/widgets/chatwidgetview.cpp @@ -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(); diff --git a/src/widgets/chatwidgetview.h b/src/widgets/chatwidgetview.h index be99d706..00af0351 100644 --- a/src/widgets/chatwidgetview.h +++ b/src/widgets/chatwidgetview.h @@ -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;