improve "last message read" indicator (#802)

This commit is contained in:
pphop
2018-10-20 16:25:24 +05:00
committed by pajlada
parent 54c1efe531
commit a584259785
5 changed files with 77 additions and 5 deletions
+14
View File
@@ -11,6 +11,7 @@
#include "widgets/helper/NotebookButton.hpp"
#include "widgets/helper/NotebookTab.hpp"
#include "widgets/helper/Shortcut.hpp"
#include "widgets/splits/Split.hpp"
#include "widgets/splits/SplitContainer.hpp"
#include <QDebug>
@@ -490,4 +491,17 @@ SplitContainer *SplitNotebook::getOrAddSelectedPage()
: this->addPage();
}
void SplitNotebook::select(QWidget *page)
{
if (auto selectedPage = this->getSelectedPage()) {
if (auto splitContainer =
dynamic_cast<SplitContainer *>(selectedPage)) {
for (auto split : splitContainer->getSplits()) {
split->updateLastReadMessage();
}
}
}
this->Notebook::select(page);
}
} // namespace chatterino