summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-04-21 13:08:30 +0000
committerDavid Athay <ko2fan@gmail.com>2008-04-21 13:08:30 +0000
commit24681ad4312d804aa06c8ace7d1a9f2f9605a4eb (patch)
treecde8781349e72fa8ed247a95036746b71f494883 /src/gui/widgets/tabbedarea.cpp
parentff6ddee79b67f756477f08cd7793b0e26bbe71d9 (diff)
downloadmana-client-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.tar.gz
mana-client-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.tar.bz2
mana-client-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.tar.xz
mana-client-24681ad4312d804aa06c8ace7d1a9f2f9605a4eb.zip
Fixed chat window size issue
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp31
1 files changed, 19 insertions, 12 deletions
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());
+}