summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-14 23:26:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-14 23:26:16 +0300
commitf9fe74c42eb543a09bfe0cf2d66e2fb54113b07e (patch)
tree05e4874736309366e302a68f2ad9b2e665479956 /src/gui/windows/chatwindow.cpp
parentcf7b983b04733a832faeb2e677f9d4d4c445b69d (diff)
downloadmv-f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e.tar.gz
mv-f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e.tar.bz2
mv-f9fe74c42eb543a09bfe0cf2d66e2fb54113b07e.tar.xz
mv-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.cpp24
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)
{