diff options
author | David Athay <ko2fan@gmail.com> | 2008-04-21 13:08:30 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-04-21 13:08:30 +0000 |
commit | 24681ad4312d804aa06c8ace7d1a9f2f9605a4eb (patch) | |
tree | cde8781349e72fa8ed247a95036746b71f494883 | |
parent | ff6ddee79b67f756477f08cd7793b0e26bbe71d9 (diff) | |
download | mana-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.tar.gz mana-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.tar.bz2 mana-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.tar.xz mana-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.zip |
Fixed chat window size issue
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/gui/chat.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 31 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.h | 5 |
4 files changed, 33 insertions, 14 deletions
@@ -1,3 +1,8 @@ +2008-04-21 David Athay <ko2fan@gmail.com> + + * src/gui/chat.cpp, src/gui/widgets/tabbedarea.cpp, + src/gui/widgets/tabbedarea.h: Fixed chat window size issue. + 2008-04-20 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/main.cpp: Added --data parameter to be used to specify where to diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 2ed6cade..8944d521 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -53,7 +53,7 @@ ChatWindow::ChatWindow(): mTmpVisible(false) { setResizable(true); - setDefaultSize(0, (windowContainer->getHeight() - 105), 600, 100); + setDefaultSize(0, (windowContainer->getHeight() - 105), 400, 100); setTitleBarHeight(5); loadWindowState("Chat"); @@ -65,6 +65,7 @@ ChatWindow::ChatWindow(): textOutput->setOpaque(false); textOutput->disableLinksAndUserColors(); textOutput->setMaxRow((int) config.getValue("ChatLogLength", 0)); + ScrollArea *scrollArea = new ScrollArea(textOutput); scrollArea->setPosition( scrollArea->getFrameSize(), scrollArea->getFrameSize()); @@ -113,7 +114,8 @@ ChatWindow::logic() ScrollArea *scroll = chan->second.scroll; scroll->setWidth(area.width - 2 * scroll->getFrameSize()); scroll->setHeight(area.height - 2 * scroll->getFrameSize() - - mChatInput->getHeight() - 26); + mChatInput->getHeight() - 5); + scroll->logic(); } Window::logic(); diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 5402bb10..cf486971 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -57,18 +57,6 @@ void TabbedArea::draw(gcn::Graphics *graphics) return; } - unsigned int i; - for (i = 0; i < mTabs.size(); i++) - { - if (mTabs[i].first == mSelectedTab) - { - mTabs[i].second->setWidth(getWidth()); - mTabs[i].second->setHeight(getHeight()); - mTabs[i].second->logic(); - break; - } - } - gcn::TabbedArea::draw(graphics); } @@ -142,3 +130,22 @@ void TabbedArea::removeTab(gcn::Tab *tab) adjustSize(); adjustTabPositions(); } + +void TabbedArea::adjustSize() +{ + int maxTabHeight = 0; + unsigned int i; + for (i = 0; i < mTabs.size(); i++) + { + if (mTabs[i].first->getHeight() > maxTabHeight) + { + maxTabHeight = mTabs[i].first->getHeight(); + } + } + + mTabContainer->setSize(getWidth() - getFrameSize(), maxTabHeight); + + mWidgetContainer->setPosition(1, maxTabHeight + 1); + mWidgetContainer->setSize(getWidth() - getFrameSize(), + getHeight() - maxTabHeight - getFrameSize()); +} diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index bc623427..b822d9c9 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -65,6 +65,11 @@ class TabbedArea : public gcn::TabbedArea * Overload the remove tab function as its broken in guichan 0.8 */ void removeTab(gcn::Tab *tab); + + /** + * Overload adjustSize as it seems faulty + */ + void adjustSize(); }; #endif |