summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-08-23 12:13:25 -0600
committerJared Adams <jaxad0127@gmail.com>2009-08-23 12:13:25 -0600
commitb20931ca66c1c760bfe21a5a6c070c54ae3eb2a0 (patch)
tree74add3e5abe7ea18bd2184e2adf6854730bfab09 /src/gui/widgets/tabbedarea.cpp
parent6a418ab3e8ce4dfbac0378e57087e84a862b875f (diff)
downloadmana-client-b20931ca66c1c760bfe21a5a6c070c54ae3eb2a0.tar.gz
mana-client-b20931ca66c1c760bfe21a5a6c070c54ae3eb2a0.tar.bz2
mana-client-b20931ca66c1c760bfe21a5a6c070c54ae3eb2a0.tar.xz
mana-client-b20931ca66c1c760bfe21a5a6c070c54ae3eb2a0.zip
Fix some layout issues with TabbedAreas
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 13bb884b..dd2e62dd 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -28,6 +28,8 @@ TabbedArea::TabbedArea() : gcn::TabbedArea()
{
mWidgetContainer->setOpaque(false);
addWidgetListener(this);
+
+ widgetResized(NULL);
}
int TabbedArea::getNumberOfTabs() const
@@ -161,14 +163,20 @@ void TabbedArea::setSelectedTab(gcn::Tab *tab)
if (newTab)
newTab->setCurrent();
+
+ widgetResized(NULL);
}
void TabbedArea::widgetResized(const gcn::Event &event)
{
- int width = getWidth() - 2 * getFrameSize();
- int height = getHeight() - 2 * getFrameSize() - mTabContainer->getHeight();
+ int width = getWidth() - 2 * getFrameSize()
+ - 2 * mWidgetContainer->getFrameSize();
+ int height = getHeight() - 2 * getFrameSize() - mWidgetContainer->getY()
+ - 2 * mWidgetContainer->getFrameSize();
mWidgetContainer->setSize(width, height);
+
gcn::Widget *w = getCurrentWidget();
if (w)
- w->setSize(width, height);
+ w->setSize(width,
+ height);
}