summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-05-05 07:03:36 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-05-05 07:03:36 +0000
commita81c08d0672965144d8ccd356cd83f9f7e834a3b (patch)
treeb2126ca0dee11bf0d5e5fe5a2a12f091eacee155 /src/gui/chat.cpp
parenta1f770ce0371272bb0bbc8b02b0b50b1fc62ae89 (diff)
downloadmana-client-a81c08d0672965144d8ccd356cd83f9f7e834a3b.tar.gz
mana-client-a81c08d0672965144d8ccd356cd83f9f7e834a3b.tar.bz2
mana-client-a81c08d0672965144d8ccd356cd83f9f7e834a3b.tar.xz
mana-client-a81c08d0672965144d8ccd356cd83f9f7e834a3b.zip
Only update the size of chat window widgets when it is resized.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 8944d521..3d63491c 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -49,13 +49,11 @@
#include "../utils/trim.h"
ChatWindow::ChatWindow():
- Window(""),
+ Window("Chat"),
mTmpVisible(false)
{
setResizable(true);
setDefaultSize(0, (windowContainer->getHeight() - 105), 400, 100);
- setTitleBarHeight(5);
- loadWindowState("Chat");
mChatInput = new ChatInput();
mChatInput->setActionEventId("chatinput");
@@ -75,7 +73,8 @@ ChatWindow::ChatWindow():
mChatTabs = new TabbedArea();
mChatTabs->addTab("General", scrollArea);
- mChatTabs->setPosition(mChatTabs->getFrameSize(), mChatTabs->getFrameSize());
+ mChatTabs->setPosition(mChatTabs->getFrameSize(),
+ mChatTabs->getFrameSize());
mChannels.insert(
std::make_pair("General", ChatArea(textOutput, scrollArea)));
@@ -86,6 +85,8 @@ ChatWindow::ChatWindow():
// Add key listener to chat input to be able to respond to up/down
mChatInput->addKeyListener(this);
mCurHist = mHistory.end();
+
+ loadWindowState("Chat");
}
ChatWindow::~ChatWindow()
@@ -94,10 +95,10 @@ ChatWindow::~ChatWindow()
delete mChatTabs;
}
-void
-ChatWindow::logic()
+void ChatWindow::widgetResized(const gcn::Event &event)
{
- // todo: only do this when the size changes (updateWidgets?)
+ Window::widgetResized(event);
+
const gcn::Rectangle area = getChildrenArea();
mChatInput->setPosition(mChatInput->getFrameSize(),
@@ -117,8 +118,6 @@ ChatWindow::logic()
mChatInput->getHeight() - 5);
scroll->logic();
}
-
- Window::logic();
}
void