summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/tabbedarea.cpp31
-rw-r--r--src/gui/widgets/tabbedarea.h5
2 files changed, 24 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());
+}
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