summaryrefslogtreecommitdiff
path: root/src/gui/chat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/chat.h')
-rw-r--r--src/gui/chat.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 085833eb..d28cecd4 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -22,9 +22,11 @@
#ifndef CHAT_H
#define CHAT_H
+#include "gui/widgets/textfield.h"
#include "gui/widgets/window.h"
#include <guichan/actionlistener.hpp>
+#include <guichan/focuslistener.hpp>
#include <guichan/keylistener.hpp>
#include <guichan/widget.hpp>
#include <guichan/widgetlistener.hpp>
@@ -54,6 +56,21 @@ struct CHATLOG
};
/**
+ * The chat input hides when it loses focus. It is also invisible by default.
+ */
+class ChatInput : public TextField, public gcn::FocusListener
+{
+ public:
+ ChatInput();
+
+ /**
+ * Called if the chat input loses focus. It will set itself to
+ * invisible as result.
+ */
+ void focusLost(const gcn::Event &event);
+};
+
+/**
* The chat window.
*
* \ingroup Interface
@@ -192,7 +209,7 @@ class ChatWindow : public Window,
Recorder *mRecorder;
/** Input box for typing chat messages. */
- gcn::TextField *mChatInput;
+ ChatInput *mChatInput;
private:
bool mTmpVisible;