mirror-chatterino2/chatwidget.cpp

44 lines
845 B
C++
Raw Normal View History

2016-12-29 17:31:07 +01:00
#include "chatwidget.h"
#include "QPainter"
#include "QFont"
#include "QFontDatabase"
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-01 02:30:42 +01:00
: QWidget(parent),
vbox(this)
2016-12-29 17:31:07 +01:00
{
2017-01-01 02:30:42 +01:00
vbox.setSpacing(0);
vbox.setMargin(1);
vbox.addWidget(&header);
vbox.addWidget(&view);
vbox.addWidget(&input);
// QFont font("Segoe UI", 15, QFont::Normal, false);
// this->font = font;
}
ChatWidget::~ChatWidget()
{
2016-12-29 17:31:07 +01:00
}
void ChatWidget::paintEvent(QPaintEvent *)
{
QPainter painter (this);
2017-01-01 02:30:42 +01:00
painter.fillRect(rect(), ColorScheme::getInstance().ChatBackground);
// QColor color (255, 0, 0);
// painter.setPen(color);
2016-12-29 17:31:07 +01:00
2017-01-01 02:30:42 +01:00
// painter.setFont(this->font);
// painter.drawRect(0, 0, width() - 1, height() - 1);
2016-12-29 17:31:07 +01:00
2017-01-01 02:30:42 +01:00
// QString text = "test text";
// painter.drawText(20, 20, text);
2016-12-29 17:31:07 +01:00
}