mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
35 lines
644 B
C++
35 lines
644 B
C++
#include "chatwidgetview.h"
|
|
#include "QScroller"
|
|
#include "QPainter"
|
|
|
|
ChatWidgetView::ChatWidgetView()
|
|
: QWidget(),
|
|
scrollbar(this),
|
|
m_channel(NULL)
|
|
{
|
|
auto scroll = QScroller::scroller(this);
|
|
|
|
scroll->scrollTo(QPointF(0, 100));
|
|
|
|
m_channel = Channel::getChannel("ian678");
|
|
}
|
|
|
|
void ChatWidgetView::resizeEvent(QResizeEvent *)
|
|
{
|
|
scrollbar.resize(scrollbar.width(), height());
|
|
scrollbar.move(width() - scrollbar.width(), 0);
|
|
}
|
|
|
|
void ChatWidgetView::paintEvent(QPaintEvent *)
|
|
{
|
|
QPainter painter(this);
|
|
|
|
auto c = channel();
|
|
|
|
if (c == NULL) return;
|
|
|
|
auto M = c->getMessagesClone();
|
|
|
|
delete M;
|
|
}
|