Fixes #53 last read message indicator

This commit is contained in:
fourtf
2018-01-23 22:48:33 +01:00
parent 418189d39c
commit 0f4ec70bf3
11 changed files with 69 additions and 7 deletions
+22 -1
View File
@@ -107,7 +107,7 @@ void Window::repaintVisibleChatWidgets(Channel *channel)
return;
}
const std::vector<Split *> &widgets = page->getChatWidgets();
const std::vector<Split *> &widgets = page->getSplits();
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
Split *widget = *it;
@@ -140,6 +140,27 @@ void Window::closeEvent(QCloseEvent *)
this->closed();
}
bool Window::event(QEvent *e)
{
switch (e->type()) {
case QEvent::WindowActivate:
break;
case QEvent::WindowDeactivate: {
auto page = this->notebook.getSelectedPage();
if (page != nullptr) {
std::vector<Split *> splits = page->getSplits();
for (Split *split : splits) {
split->updateLastReadMessage();
}
}
} break;
};
return BaseWindow::event(e);
}
void Window::loadGeometry()
{
bool doSetGeometry = false;