diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-14 23:26:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-14 23:26:16 +0300 |
commit | f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e (patch) | |
tree | 05e4874736309366e302a68f2ad9b2e665479956 /src/gui/windows/chatwindow.cpp | |
parent | cf7b983b04733a832faeb2e677f9d4d4c445b69d (diff) | |
download | plus-f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e.tar.gz plus-f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e.tar.bz2 plus-f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e.tar.xz plus-f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e.zip |
Allow open/close chat input by double click on chat window.
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index d7d5f690a..fe20fe935 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -731,9 +731,19 @@ void ChatWindow::mousePressed(MouseEvent &event) if (event.getButton() == MouseButton::LEFT) { - const ChatTab *const tab = getFocused(); - if (tab) - mMoved = !isResizeAllowed(event); + const int clicks = event.getClickCount(); + if (clicks == 2) + { + toggleChatFocus(); + if (gui) + gui->resetClickCount(); + } + else if (clicks == 1) + { + const ChatTab *const tab = getFocused(); + if (tab) + mMoved = !isResizeAllowed(event); + } } mDragOffsetX = event.getX(); @@ -2185,6 +2195,14 @@ void ChatWindow::showGMTab() } } +void ChatWindow::toggleChatFocus() +{ + if (mChatInput->isVisible() && mChatInput->isFocused()) + mChatInput->processVisible(Visible_false); + else + requestChatFocus(); +} + #ifdef EATHENA_SUPPORT void ChatWindow::joinRoom(const bool isJoin) { |