/[packages]/cauldron/manaplus/current/SOURCES/0002-Fix-chat-tab-size-issue-if-enabled-hiding-chat-input.patch
ViewVC logotype

Contents of /cauldron/manaplus/current/SOURCES/0002-Fix-chat-tab-size-issue-if-enabled-hiding-chat-input.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 96497 - (show annotations) (download)
Sun May 8 16:38:42 2011 UTC (13 years, 5 months ago) by alien
File size: 1906 byte(s)
- Fix chat tab size when hiding chat input (upstream patch)
- Improve algorithm for cleaning sdltext cache (fixes memleak; upstream patch)

1 From 946c94cb1fc3273c437efb45f85b44b8ae48ab5f Mon Sep 17 00:00:00 2001
2 From: Andrei Karas <akaras@inbox.ru>
3 Date: Sun, 8 May 2011 16:11:38 +0300
4 Subject: [PATCH 2/3] Fix chat tab size issue, if enabled hiding chat input.
5
6 ---
7 src/gui/chatwindow.cpp | 17 +++++++----------
8 1 files changed, 7 insertions(+), 10 deletions(-)
9
10 diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
11 index 37a16b4..09c37d9 100644
12 --- a/src/gui/chatwindow.cpp
13 +++ b/src/gui/chatwindow.cpp
14 @@ -71,8 +71,9 @@
15 class ChatInput : public TextField, public gcn::FocusListener
16 {
17 public:
18 - ChatInput(TabbedArea *tabs):
19 + ChatInput(ChatWindow *window, TabbedArea *tabs):
20 TextField("", false),
21 + mWindow(window),
22 mChatTabs(tabs)
23 {
24 setVisible(false);
25 @@ -90,20 +91,16 @@ class ChatInput : public TextField, public gcn::FocusListener
26
27 void processVisible(bool n)
28 {
29 - if (!mChatTabs || isVisible() == n)
30 + if (!mWindow || isVisible() == n)
31 return;
32
33 - if (config.getBoolValue("hideChatInput"))
34 - {
35 - if (n)
36 - mChatTabs->setHeight(mChatTabs->getHeight() - getHeight());
37 - else
38 - mChatTabs->setHeight(mChatTabs->getHeight() + getHeight());
39 - }
40 setVisible(n);
41 + if (config.getBoolValue("hideChatInput"))
42 + mWindow->adjustTabSize();
43 }
44
45 private:
46 + ChatWindow *mWindow;
47 TabbedArea *mChatTabs;
48 };
49
50 @@ -177,7 +174,7 @@ ChatWindow::ChatWindow():
51 mChatTabs->enableScrollButtons(true);
52 mChatTabs->setFollowDownScroll(true);
53
54 - mChatInput = new ChatInput(mChatTabs);
55 + mChatInput = new ChatInput(this, mChatTabs);
56 mChatInput->setActionEventId("chatinput");
57 mChatInput->addActionListener(this);
58
59 --
60 1.7.1
61

  ViewVC Help
Powered by ViewVC 1.1.30