diff options
author | Stijn Buys <ingar@osirion.org> | 2011-09-04 17:39:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-09-04 17:39:39 +0000 |
commit | edd5dfcd15198f5d5d277835fdf75108eb67472d (patch) | |
tree | 962dbf54f5d76352c5ec3d12b328695c538e0c4d /src/client | |
parent | 5afce7d29a2d852446b58b4410c43d7bf2063b11 (diff) |
Fixed the close button on the chat window.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/chat.cc | 14 | ||||
-rw-r--r-- | src/client/chat.h | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/client/chat.cc b/src/client/chat.cc index 8a09883..c49550e 100644 --- a/src/client/chat.cc +++ b/src/client/chat.cc @@ -103,6 +103,18 @@ void Chat::toggle() show(); } +bool Chat::on_emit(ui::Widget *sender, const ui::Widget::Event event, void *data) +{ + if (sender == chat_closebutton) { + if (event == ui::Widget::EventButtonClicked) { + hide(); + return true; + } + } + + return Window::on_emit(sender, event, data); +} + bool Chat::on_keypress(const int key, const unsigned int modifier) { // number of lines to scroll @@ -250,7 +262,7 @@ void Chat::resize() chat_playerlist->set_size(ui::UI::elementsize.width() * 1.5f, height() - chat_playerlist->top() - padding * 2.0f); // resize chat text pane - chat_scrollpane->set_location(chat_playerlist->right() + padding, padding); + chat_scrollpane->set_location(chat_playerlist->right() + padding, chat_titlelabel->bottom() + padding); chat_scrollpane->set_size(width() - chat_scrollpane->left() - padding, chat_playerlist->height()); } diff --git a/src/client/chat.h b/src/client/chat.h index ca0ff72..9b64297 100644 --- a/src/client/chat.h +++ b/src/client/chat.h @@ -45,6 +45,8 @@ protected: virtual bool on_keypress(const int key, const unsigned int modifier); + virtual bool on_emit(ui::Widget *sender, const ui::Widget::Event event, void *data); + /** * @brief set the chatbox prompt to 'say:' or 'command:' depending on the current input text. */ |