summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-20 15:12:16 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-20 15:12:16 (GMT)
commita1d2cc819f381db6b7371c55d3c22ffe56596aed (patch)
treefde0ccfc77b9b74e0527db0b45781b5d4accdd3f /Swift/QtUI/QtChatWindow.cpp
parent7e78cc2b173db39f12e92a929ad17b706877e33d (diff)
downloadswift-a1d2cc819f381db6b7371c55d3c22ffe56596aed.zip
swift-a1d2cc819f381db6b7371c55d3c22ffe56596aed.tar.bz2
Focus the chat input again when the chat log is clicked.
Resolves: #532
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r--Swift/QtUI/QtChatWindow.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index f39353c..5b73fec 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -44,7 +44,6 @@ QtChatWindow::QtChatWindow(const QString &contact, UIEventStream* eventStream) :
layout->addWidget(logRosterSplitter);
messageLog_ = new QtChatView(this);
- messageLog_->setFocusPolicy(Qt::NoFocus);
logRosterSplitter->addWidget(messageLog_);
treeWidget_ = new QtTreeWidget(eventStream_);
@@ -59,6 +58,7 @@ QtChatWindow::QtChatWindow(const QString &contact, UIEventStream* eventStream) :
midBarLayout->setContentsMargins(0,0,0,0);
midBarLayout->setSpacing(2);
midBarLayout->addStretch();
+
labelsWidget_ = new QComboBox(this);
labelsWidget_->setFocusPolicy(Qt::NoFocus);
labelsWidget_->hide();
@@ -76,9 +76,13 @@ QtChatWindow::QtChatWindow(const QString &contact, UIEventStream* eventStream) :
connect(input_, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
connect(input_, SIGNAL(textChanged()), this, SLOT(handleInputChanged()));
setFocusProxy(input_);
+ logRosterSplitter->setFocusProxy(input_);
+ midBar->setFocusProxy(input_);
+ messageLog_->setFocusProxy(input_);
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(qAppFocusChanged(QWidget*, QWidget*)));
-
+ connect(messageLog_, SIGNAL(gotFocus()), input_, SLOT(setFocus()));
resize(400,300);
+ input_->setFocus();
}
QtChatWindow::~QtChatWindow() {
@@ -347,6 +351,7 @@ void QtChatWindow::handleInputChanged() {
void QtChatWindow::show() {
QWidget::show();
emit windowOpening();
+ input_->setFocus();
}
void QtChatWindow::activate() {
@@ -354,6 +359,7 @@ void QtChatWindow::activate() {
QWidget::show();
}
emit wantsToActivate();
+ input_->setFocus();
}
void QtChatWindow::resizeEvent(QResizeEvent*) {