mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
added option to refresh only certain channels
This commit is contained in:
parent
1194905646
commit
bacb183cdb
9 changed files with 47 additions and 16 deletions
|
@ -67,7 +67,8 @@ SOURCES += main.cpp\
|
||||||
windows.cpp \
|
windows.cpp \
|
||||||
chatwidgetheaderbutton.cpp \
|
chatwidgetheaderbutton.cpp \
|
||||||
chatwidgetheaderbuttonlabel.cpp \
|
chatwidgetheaderbuttonlabel.cpp \
|
||||||
channels.cpp
|
channels.cpp \
|
||||||
|
textinputform.cpp
|
||||||
|
|
||||||
HEADERS += mainwindow.h \
|
HEADERS += mainwindow.h \
|
||||||
chatwidget.h \
|
chatwidget.h \
|
||||||
|
@ -106,7 +107,8 @@ HEADERS += mainwindow.h \
|
||||||
windows.h \
|
windows.h \
|
||||||
chatwidgetheaderbutton.h \
|
chatwidgetheaderbutton.h \
|
||||||
chatwidgetheaderbuttonlabel.h \
|
chatwidgetheaderbuttonlabel.h \
|
||||||
channels.h
|
channels.h \
|
||||||
|
textinputform.h
|
||||||
|
|
||||||
PRECOMPILED_HEADER =
|
PRECOMPILED_HEADER =
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,12 @@ public:
|
||||||
return m_view;
|
return m_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Channel *
|
||||||
|
channel() const
|
||||||
|
{
|
||||||
|
return m_channel;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
|
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
ChatWidgetHeaderButtonLabel::ChatWidgetHeaderButtonLabel()
|
ChatWidgetHeaderButtonLabel::ChatWidgetHeaderButtonLabel()
|
||||||
{
|
{
|
||||||
|
setAlignment(Qt::AlignCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -27,7 +27,7 @@ MainWindow::~MainWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MainWindow::layoutVisibleChatWidgets()
|
MainWindow::layoutVisibleChatWidgets(Channel *channel)
|
||||||
{
|
{
|
||||||
auto *page = notebook.selected();
|
auto *page = notebook.selected();
|
||||||
|
|
||||||
|
@ -40,14 +40,16 @@ MainWindow::layoutVisibleChatWidgets()
|
||||||
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
|
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
|
||||||
ChatWidget *widget = *it;
|
ChatWidget *widget = *it;
|
||||||
|
|
||||||
if (widget->view().layoutMessages()) {
|
if (channel == NULL || channel == widget->channel()) {
|
||||||
widget->repaint();
|
if (widget->view().layoutMessages()) {
|
||||||
|
widget->repaint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MainWindow::repaintVisibleChatWidgets()
|
MainWindow::repaintVisibleChatWidgets(Channel *channel)
|
||||||
{
|
{
|
||||||
auto *page = notebook.selected();
|
auto *page = notebook.selected();
|
||||||
|
|
||||||
|
@ -60,7 +62,9 @@ MainWindow::repaintVisibleChatWidgets()
|
||||||
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
|
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
|
||||||
ChatWidget *widget = *it;
|
ChatWidget *widget = *it;
|
||||||
|
|
||||||
widget->view().layoutMessages();
|
if (channel == NULL || channel == widget->channel()) {
|
||||||
widget->repaint();
|
widget->view().layoutMessages();
|
||||||
|
widget->repaint();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ public:
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
Notebook notebook;
|
Notebook notebook;
|
||||||
|
|
||||||
void layoutVisibleChatWidgets();
|
void layoutVisibleChatWidgets(Channel *channel = NULL);
|
||||||
void repaintVisibleChatWidgets();
|
void repaintVisibleChatWidgets(Channel *channel = NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
6
textinputform.cpp
Normal file
6
textinputform.cpp
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#include "textinputform.h"
|
||||||
|
|
||||||
|
TextInputForm::TextInputForm()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
12
textinputform.h
Normal file
12
textinputform.h
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#ifndef TEXTINPUTFORM_H
|
||||||
|
#define TEXTINPUTFORM_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
class TextInputForm : public QDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TextInputForm();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TEXTINPUTFORM_H
|
|
@ -5,13 +5,13 @@ QMutex Windows::m_windowMutex;
|
||||||
MainWindow *Windows::m_mainWindow(NULL);
|
MainWindow *Windows::m_mainWindow(NULL);
|
||||||
|
|
||||||
void
|
void
|
||||||
Windows::layoutVisibleChatWidgets()
|
Windows::layoutVisibleChatWidgets(Channel *channel)
|
||||||
{
|
{
|
||||||
m_mainWindow->layoutVisibleChatWidgets();
|
m_mainWindow->layoutVisibleChatWidgets(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Windows::repaintVisibleChatWidgets()
|
Windows::repaintVisibleChatWidgets(Channel *channel)
|
||||||
{
|
{
|
||||||
m_mainWindow->repaintVisibleChatWidgets();
|
m_mainWindow->repaintVisibleChatWidgets(channel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
class Windows
|
class Windows
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void layoutVisibleChatWidgets();
|
static void layoutVisibleChatWidgets(Channel *channel = NULL);
|
||||||
static void repaintVisibleChatWidgets();
|
static void repaintVisibleChatWidgets(Channel *channel = NULL);
|
||||||
|
|
||||||
static MainWindow &
|
static MainWindow &
|
||||||
mainWindow()
|
mainWindow()
|
||||||
|
|
Loading…
Reference in a new issue