From c76f6a7e73cc38c6319028271e317b9c11db15b2 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Wed, 10 Sep 2014 22:53:02 +0200 Subject: [PATCH] Fix #275 --- widget/form/chatform.cpp | 5 +++++ widget/form/chatform.h | 1 + widget/widget.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/widget/form/chatform.cpp b/widget/form/chatform.cpp index d52fd9d53..05a986048 100644 --- a/widget/form/chatform.cpp +++ b/widget/form/chatform.cpp @@ -443,3 +443,8 @@ void ChatForm::onFileTansBtnClicked(QString widgetName, QString buttonName) else qDebug() << "no filetransferwidget: " << id; } + +void ChatForm::focusInput() +{ + msgEdit->setFocus(); +} diff --git a/widget/form/chatform.h b/widget/form/chatform.h index 9407f1c11..8fe92b2ce 100644 --- a/widget/form/chatform.h +++ b/widget/form/chatform.h @@ -55,6 +55,7 @@ public slots: void onAvPeerTimeout(int FriendId, int CallId); void onAvMediaChange(int FriendId, int CallId, bool video); void onMicMuteToggle(); + void focusInput(); private slots: void onSendTriggered(); diff --git a/widget/widget.cpp b/widget/widget.cpp index d08ea0fe1..dbdc65af4 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -411,6 +411,7 @@ void Widget::addFriend(int friendId, const QString &userId) connect(newfriend->widget, SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*)), this, SLOT(onChatroomWidgetClicked(GenericChatroomWidget*))); connect(newfriend->widget, SIGNAL(removeFriend(int)), this, SLOT(removeFriend(int))); connect(newfriend->widget, SIGNAL(copyFriendIdToClipboard(int)), this, SLOT(copyFriendIdToClipboard(int))); + connect(newfriend->widget, SIGNAL(chatroomWidgetClicked(GenericChatroomWidget*)), newfriend->chatForm, SLOT(focusInput())); connect(newfriend->chatForm, SIGNAL(sendMessage(int,QString)), core, SLOT(sendMessage(int,QString))); connect(newfriend->chatForm, SIGNAL(sendFile(int32_t, QString, QString, long long)), core, SLOT(sendFile(int32_t, QString, QString, long long))); connect(newfriend->chatForm, SIGNAL(answerCall(int)), core, SLOT(answerCall(int)));