diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/chatwindow.cpp | 17 |
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); |