summaryrefslogtreecommitdiff
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
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.
-rw-r--r--src/gui/windows/chatwindow.cpp24
-rw-r--r--src/gui/windows/chatwindow.h2
2 files changed, 23 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)
{
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index c13338d7c..49c068a0f 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -371,6 +371,8 @@ class ChatWindow final : public Window,
void initTradeFilter();
+ void toggleChatFocus();
+
unsigned int mRainbowColor;
private: