Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 05cc51920a41c76f49292e57bcb95121 > files > 2

manaplus-1.1.5.1-5.mga1.src.rpm

From 946c94cb1fc3273c437efb45f85b44b8ae48ab5f Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Sun, 8 May 2011 16:11:38 +0300
Subject: [PATCH 2/3] Fix chat tab size issue, if enabled hiding chat input.

---
 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 37a16b4..09c37d9 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);
 
-- 
1.7.1