summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: