removed autoscoll and gotobottom from emotepopup

This commit is contained in:
2017-12-28 00:48:21 +01:00
parent 4aa995c74a
commit ece0482502
3 changed files with 19 additions and 2 deletions
+13 -2
View File
@@ -45,7 +45,8 @@ ChannelView::ChannelView(BaseWidget *parent)
this->scrollBar.getCurrentValueChanged().connect([this] {
// Whenever the scrollbar value has been changed, re-render the ChatWidgetView
this->layoutMessages();
this->goToBottom->setVisible(this->scrollBar.isVisible() && !this->scrollBar.isAtBottom());
this->goToBottom->setVisible(this->enableScrollingToBottom && this->scrollBar.isVisible() &&
!this->scrollBar.isAtBottom());
this->queueUpdate();
});
@@ -178,7 +179,7 @@ void ChannelView::actuallyLayoutMessages()
this->scrollBar.setMaximum(messagesSnapshot.getLength());
if (this->showingLatestMessages && showScrollbar) {
if (this->enableScrollingToBottom && this->showingLatestMessages && showScrollbar) {
// If we were showing the latest messages and the scrollbar now wants to be rendered, scroll
// to bottom
// TODO: Do we want to check if the user is currently moving the scrollbar?
@@ -329,6 +330,16 @@ void ChannelView::clearSelection()
layoutMessages();
}
void ChannelView::setEnableScrollingToBottom(bool value)
{
this->enableScrollingToBottom = value;
}
bool ChannelView::getEnableScrollingToBottom() const
{
return this->enableScrollingToBottom;
}
messages::LimitedQueueSnapshot<SharedMessageRef> ChannelView::getMessagesSnapshot()
{
return this->messages.getSnapshot();