diff options
author | Tobias Markmann <tm@ayena.de> | 2015-09-08 07:59:58 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-09-18 08:07:39 (GMT) |
commit | 9be5ebf772f03cdaea50bf33b70f30dd4f1c0dd2 (patch) | |
tree | 66594d99a94f1a23d4581c245d7829719061301c | |
parent | 950881debd593de9b6d483894246af9ad0c9b1d9 (diff) | |
download | swift-9be5ebf772f03cdaea50bf33b70f30dd4f1c0dd2.zip swift-9be5ebf772f03cdaea50bf33b70f30dd4f1c0dd2.tar.bz2 |
Set keyboard focus to text input after selecting an emoticon
After selecting an emoticon on Windows the keyboard focus does not
return to the text input. OS X did not exhibit that behavior.
This fix explicitly sets the focus back to the text input after
selection of an emoticon, as expected by the user.
Test-Information:
Verified the behavior on OS X 10.9.5 and Windows 7, both with
Qt 5.4.2.
Change-Id: I8737a7e3f6d1a6b7a8e60261e9bd14c7be8d07a6
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 2 | ||||
-rw-r--r-- | Swift/QtUI/QtChatWindow.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index ffcbf15..3818991 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -46,12 +46,13 @@ #include <Swift/Controllers/UIEvents/UIEventStream.h> #include <SwifTools/TabComplete.h> #include <Swift/QtUI/QtAddBookmarkWindow.h> #include <Swift/QtUI/QtEditBookmarkWindow.h> +#include <Swift/QtUI/QtEmoticonsGrid.h> #include <Swift/QtUI/QtPlainChatView.h> #include <Swift/QtUI/QtScaledAvatarCache.h> #include <Swift/QtUI/QtSettingsProvider.h> #include <Swift/QtUI/QtTextEdit.h> #include <Swift/QtUI/QtUISettingConstants.h> #include <Swift/QtUI/QtUtilities.h> @@ -642,12 +643,13 @@ void QtChatWindow::handleEmoticonsButtonClicked() { QSize menuSize = emoticonsMenu_->size(); emoticonsMenu_->exec(QPoint(QCursor::pos().x() - menuSize.width(), QCursor::pos().y() - menuSize.height())); } void QtChatWindow::handleEmoticonClicked(QString emoticonAsText) { input_->textCursor().insertText(emoticonAsText); + input_->setFocus(); } void QtChatWindow::handleTextInputReceivedFocus() { lastLineTracker_.setHasFocus(true); input_->setFocus(); onAllMessagesRead(); diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h index 19046c9..8d7db59 100644 --- a/Swift/QtUI/QtChatWindow.h +++ b/Swift/QtUI/QtChatWindow.h @@ -17,13 +17,12 @@ #include <Swift/Controllers/UIInterfaces/ChatWindow.h> #include <SwifTools/LastLineTracker.h> #include <Swift/QtUI/ChatSnippet.h> #include <Swift/QtUI/QtAffiliationEditor.h> -#include <Swift/QtUI/QtEmoticonsGrid.h> #include <Swift/QtUI/QtMUCConfigurationWindow.h> #include <Swift/QtUI/QtSwiftUtil.h> #include <Swift/QtUI/QtTabbable.h> class QTextEdit; class QLineEdit; @@ -38,12 +37,13 @@ namespace Swift { class QtChatTheme; class TreeWidget; class QtTextEdit; class UIEventStream; class QtChatWindowJSBridge; class SettingsProvider; + class QtEmoticonsGrid; class LabelModel : public QAbstractListModel { Q_OBJECT public: LabelModel(QObject* parent = NULL) : QAbstractListModel(parent) {} |