diff options
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 |