diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-30 14:33:28 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-30 14:33:28 +0000 |
commit | aff167beefadc32add4b44626cc2f1cbef800c7b (patch) | |
tree | 43796105cc107ec55742e88562e064d8031d3b23 /src/gui/chat.cpp | |
parent | 18b73fdadd715d356416a95c31a25b3293fa2596 (diff) | |
download | mana-aff167beefadc32add4b44626cc2f1cbef800c7b.tar.gz mana-aff167beefadc32add4b44626cc2f1cbef800c7b.tar.bz2 mana-aff167beefadc32add4b44626cc2f1cbef800c7b.tar.xz mana-aff167beefadc32add4b44626cc2f1cbef800c7b.zip |
Updated TMW to be compatible with Guichan 0.5.0 (merged from guichan-0.5.0
branch).
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 870582df..133e5e3a 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -85,18 +85,17 @@ ChatWindow::~ChatWindow() 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(); } @@ -189,7 +188,7 @@ ChatWindow::chatLog(CHATSKILL act) } void -ChatWindow::action(const std::string& eventId) +ChatWindow::action(const std::string &eventId, gcn::Widget *widget) { if (eventId == "chatinput") { @@ -246,7 +245,7 @@ ChatWindow::requestChatFocus() bool ChatWindow::isFocused() { - return mChatInput->hasFocus(); + return mChatInput->isFocused(); } void |