summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 10:20:19 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 10:20:19 +0000
commitd3385829ca6f7d52e21706b25b14fe1083cfe984 (patch)
treeaea368b2434a49864b33183f95b6aae36abef3b7 /src/gui/chat.cpp
parent7d287027babe615e01ddcf20edc1057f7d778c58 (diff)
downloadmana-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.gz
mana-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.bz2
mana-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.xz
mana-d3385829ca6f7d52e21706b25b14fe1083cfe984.zip
Merged Guichan 0.5.0 support from guichan-0.5.0 branch, plus several updates
from the 0.1.0 branch.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 92412dde..77c44332 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -77,18 +77,17 @@ ChatWindow::ChatWindow(Network *network):
void
ChatWindow::logic()
{
- mChatInput->setPosition(
- mChatInput->getBorderSize(),
- getContent()->getHeight() - mChatInput->getHeight() -
- mChatInput->getBorderSize());
- mChatInput->setWidth(
- getContent()->getWidth() - 2 * mChatInput->getBorderSize());
-
- mScrollArea->setWidth(
- getContent()->getWidth() - 2 * mScrollArea->getBorderSize());
- mScrollArea->setHeight(
- getContent()->getHeight() - 2 * mScrollArea->getBorderSize() -
- mChatInput->getHeight() - 5);
+ // todo: only do this when the size changes (updateWidgets?)
+
+ const gcn::Rectangle area = getChildrenArea();
+
+ mChatInput->setPosition(mChatInput->getBorderSize(),
+ area.height - mChatInput->getHeight() -
+ mChatInput->getBorderSize());
+ mChatInput->setWidth(area.width - 2 * mChatInput->getBorderSize());
+ mScrollArea->setWidth(area.width - 2 * mScrollArea->getBorderSize());
+ mScrollArea->setHeight(area.height - 2 * mScrollArea->getBorderSize() -
+ mChatInput->getHeight() - 5);
mScrollArea->logic();
}
@@ -181,7 +180,7 @@ ChatWindow::chatLog(CHATSKILL act)
}
void
-ChatWindow::action(const std::string& eventId)
+ChatWindow::action(const std::string& eventId, gcn::Widget* widget)
{
if (eventId == "chatinput")
{
@@ -238,7 +237,7 @@ ChatWindow::requestChatFocus()
bool
ChatWindow::isFocused()
{
- return mChatInput->hasFocus();
+ return mChatInput->isFocused();
}
void