From 11b2d40e987fa971ae146267ba79b4acdba5f1b1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 8 May 2011 16:11:38 +0300 Subject: Fix chat tab size issue, if enabled hiding chat input. --- src/gui/chatwindow.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/gui/chatwindow.cpp') 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); -- cgit v1.2.3-60-g2f50