2016-12-29 17:31:07 +01:00
|
|
|
#include "chatwidget.h"
|
|
|
|
#include "QFont"
|
|
|
|
#include "QFontDatabase"
|
2017-01-11 18:52:09 +01:00
|
|
|
#include "QPainter"
|
2017-01-01 02:30:42 +01:00
|
|
|
#include "QVBoxLayout"
|
|
|
|
#include "colorscheme.h"
|
2016-12-29 17:31:07 +01:00
|
|
|
|
|
|
|
ChatWidget::ChatWidget(QWidget *parent)
|
2017-01-11 18:52:09 +01:00
|
|
|
: QWidget(parent)
|
2017-01-16 18:27:51 +01:00
|
|
|
, m_header(this)
|
2017-01-16 03:15:07 +01:00
|
|
|
, m_vbox(this)
|
2016-12-29 17:31:07 +01:00
|
|
|
{
|
2017-01-16 03:15:07 +01:00
|
|
|
m_vbox.setSpacing(0);
|
|
|
|
m_vbox.setMargin(1);
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-01-16 03:15:07 +01:00
|
|
|
m_vbox.addWidget(&m_header);
|
|
|
|
m_vbox.addWidget(&m_view);
|
|
|
|
m_vbox.addWidget(&m_input);
|
2017-01-01 02:30:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ChatWidget::~ChatWidget()
|
|
|
|
{
|
2016-12-29 17:31:07 +01:00
|
|
|
}
|
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
void
|
|
|
|
ChatWidget::paintEvent(QPaintEvent *)
|
2016-12-29 17:31:07 +01:00
|
|
|
{
|
2017-01-11 18:52:09 +01:00
|
|
|
QPainter painter(this);
|
2016-12-29 17:31:07 +01:00
|
|
|
|
2017-01-06 23:28:48 +01:00
|
|
|
painter.fillRect(rect(), ColorScheme::instance().ChatBackground);
|
2016-12-29 17:31:07 +01:00
|
|
|
}
|