summary refs log tree commit diff
path: root/src/TextInputWidget.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-30 15:13:15 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-30 15:13:15 +0300
commit5b5d35fd1f33555f6dacecacaf53a18517218b79 (patch)
treea0c9dbba27ff5826c906fd6bbc5b6587c2d149ea /src/TextInputWidget.cc
parentAllow arbitrary resizing of the main window & restore sidebar's size (diff)
downloadnheko-5b5d35fd1f33555f6dacecacaf53a18517218b79.tar.xz
Add basic support for replies (#292)
Diffstat (limited to 'src/TextInputWidget.cc')
-rw-r--r--src/TextInputWidget.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/TextInputWidget.cc b/src/TextInputWidget.cc

index acb33fa7..7ee7fa16 100644 --- a/src/TextInputWidget.cc +++ b/src/TextInputWidget.cc
@@ -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); +}