void BufferWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { ChatView *prevView = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget()); AbstractBufferContainer::currentChanged(current, previous); // switch first to avoid a redraw // we need to hide the marker line if it's already/still at the bottom of the view (and not scrolled up) ChatView *curView = qobject_cast<ChatView *>(ui.stackedWidget->currentWidget()); if(curView) { BufferId curBufferId = current.data(NetworkModel::BufferIdRole).value<BufferId>(); if(curBufferId.isValid()) { MsgId markerMsgId = Client::networkModel()->markerLineMsgId(curBufferId); if(markerMsgId == curView->lastMsgId() && markerMsgId == curView->lastVisibleMsgId()) curView->setMarkerLineVisible(false); else curView->setMarkerLineVisible(true); } } if(prevView && autoMarkerLine()) setMarkerLine(prevView, false); }