summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-08-29 10:25:14 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-08-29 10:25:14 (GMT)
commit9c79d93c3a98b9507f42c2f564916e0ef975c525 (patch)
treea14f4abb4f8c2adec4e11603f21b484853bc7bd2 /Swift/QtUI/QtChatWindow.cpp
parent52b06bd89d91e2f5e0c1ae439cd1e5c3e4b9bf2e (diff)
downloadswift-contrib-9c79d93c3a98b9507f42c2f564916e0ef975c525.zip
swift-contrib-9c79d93c3a98b9507f42c2f564916e0ef975c525.tar.bz2
Allow multi-line inputs, and grow accordingly.
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r--Swift/QtUI/QtChatWindow.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index 2e08adb..b7987b9 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -5,6 +5,7 @@
#include "QtChatView.h"
#include "MessageSnippet.h"
#include "SystemMessageSnippet.h"
+#include "QtTextEdit.h"
#include <QApplication>
#include <QBoxLayout>
@@ -50,9 +51,10 @@ QtChatWindow::QtChatWindow(const QString &contact, QtTreeWidgetFactory *treeWidg
labelsWidget_->setSizeAdjustPolicy(QComboBox::AdjustToContents);
midBarLayout->addWidget(labelsWidget_,0);
- input_ = new QLineEdit(this);
+ input_ = new QtTextEdit(this);
+ input_->setAcceptRichText(false);
layout->addWidget(input_);
-
+
connect(input_, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
setFocusProxy(input_);
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(qAppFocusChanged(QWidget*, QWidget*)));
@@ -106,6 +108,7 @@ void QtChatWindow::convertToMUC() {
void QtChatWindow::qAppFocusChanged(QWidget *old, QWidget *now) {
Q_UNUSED(old);
+ Q_UNUSED(now);
if (isWidgetSelected()) {
onAllMessagesRead();
}
@@ -182,7 +185,7 @@ void QtChatWindow::addSystemMessage(const String& message) {
}
void QtChatWindow::returnPressed() {
- onSendMessageRequest(Q2PSTRING(input_->text()));
+ onSendMessageRequest(Q2PSTRING(input_->toPlainText()));
messageLog_->scrollToBottom();
input_->clear();
}