summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-08 16:11:38 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-08 16:11:38 +0300
commit11b2d40e987fa971ae146267ba79b4acdba5f1b1 (patch)
tree81692ea571a6e765db8693e26fb034360f5bf34f /src/gui/chatwindow.cpp
parentefef5c2b07c1b51ec67d59bbbd177afc2f7f1724 (diff)
downloadmanaverse-11b2d40e987fa971ae146267ba79b4acdba5f1b1.tar.gz
manaverse-11b2d40e987fa971ae146267ba79b4acdba5f1b1.tar.bz2
manaverse-11b2d40e987fa971ae146267ba79b4acdba5f1b1.tar.xz
manaverse-11b2d40e987fa971ae146267ba79b4acdba5f1b1.zip
Fix chat tab size issue, if enabled hiding chat input.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 37a16b429..09c37d952 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -71,8 +71,9 @@
class ChatInput : public TextField, public gcn::FocusListener
{
public:
- ChatInput(TabbedArea *tabs):
+ ChatInput(ChatWindow *window, TabbedArea *tabs):
TextField("", false),
+ mWindow(window),
mChatTabs(tabs)
{
setVisible(false);
@@ -90,20 +91,16 @@ class ChatInput : public TextField, public gcn::FocusListener
void processVisible(bool n)
{
- if (!mChatTabs || isVisible() == n)
+ if (!mWindow || isVisible() == n)
return;
- if (config.getBoolValue("hideChatInput"))
- {
- if (n)
- mChatTabs->setHeight(mChatTabs->getHeight() - getHeight());
- else
- mChatTabs->setHeight(mChatTabs->getHeight() + getHeight());
- }
setVisible(n);
+ if (config.getBoolValue("hideChatInput"))
+ mWindow->adjustTabSize();
}
private:
+ ChatWindow *mWindow;
TabbedArea *mChatTabs;
};
@@ -177,7 +174,7 @@ ChatWindow::ChatWindow():
mChatTabs->enableScrollButtons(true);
mChatTabs->setFollowDownScroll(true);
- mChatInput = new ChatInput(mChatTabs);
+ mChatInput = new ChatInput(this, mChatTabs);
mChatInput->setActionEventId("chatinput");
mChatInput->addActionListener(this);