added option to refresh only certain channels

This commit is contained in:
fourtf
2017-01-16 15:06:12 +01:00
parent 1194905646
commit bacb183cdb
9 changed files with 47 additions and 16 deletions
+10 -6
View File
@@ -27,7 +27,7 @@ MainWindow::~MainWindow()
}
void
MainWindow::layoutVisibleChatWidgets()
MainWindow::layoutVisibleChatWidgets(Channel *channel)
{
auto *page = notebook.selected();
@@ -40,14 +40,16 @@ MainWindow::layoutVisibleChatWidgets()
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
ChatWidget *widget = *it;
if (widget->view().layoutMessages()) {
widget->repaint();
if (channel == NULL || channel == widget->channel()) {
if (widget->view().layoutMessages()) {
widget->repaint();
}
}
}
}
void
MainWindow::repaintVisibleChatWidgets()
MainWindow::repaintVisibleChatWidgets(Channel *channel)
{
auto *page = notebook.selected();
@@ -60,7 +62,9 @@ MainWindow::repaintVisibleChatWidgets()
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
ChatWidget *widget = *it;
widget->view().layoutMessages();
widget->repaint();
if (channel == NULL || channel == widget->channel()) {
widget->view().layoutMessages();
widget->repaint();
}
}
}