Add basic support for replies (#292)

This commit is contained in:
Konstantinos Sideris 2018-06-30 15:13:15 +03:00
parent d56446ce97
commit 5b5d35fd1f
7 changed files with 41 additions and 1 deletions

View file

@ -614,3 +614,14 @@ TextInputWidget::paintEvent(QPaintEvent *)
p.setPen(QPen(borderColor()));
p.drawLine(QPointF(0, 0), QPointF(width(), 0));
}
void
TextInputWidget::addReply(const QString &username, const QString &msg)
{
input_->setText(QString("> %1: %2\n\n").arg(username).arg(msg));
input_->setFocus();
auto cursor = input_->textCursor();
cursor.movePosition(QTextCursor::End);
input_->setTextCursor(cursor);
}