summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-08-10 20:28:23 -0600
committerJared Adams <jaxad0127@gmail.com>2009-08-10 20:28:23 -0600
commit9af6e761373f25b56e815f1f75b44473474cf280 (patch)
tree4393f9297c892fc1289c29eb4753462554b498df /src/gui/widgets/tabbedarea.cpp
parent56865a2c98a589a1e530e296b1681e369e2ae48f (diff)
downloadmana-client-9af6e761373f25b56e815f1f75b44473474cf280.tar.gz
mana-client-9af6e761373f25b56e815f1f75b44473474cf280.tar.bz2
mana-client-9af6e761373f25b56e815f1f75b44473474cf280.tar.xz
mana-client-9af6e761373f25b56e815f1f75b44473474cf280.zip
Fix TabbedArea and ScrollArea to resize contents
Also remove that code from SkillDialog. I tried to do the same with ChatWindow, but it kept segfaulting. Will try again later.
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index bb5ae9a4..2de812ed 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -27,6 +27,7 @@
TabbedArea::TabbedArea() : gcn::TabbedArea()
{
mWidgetContainer->setOpaque(false);
+ addWidgetListener(this);
}
int TabbedArea::getNumberOfTabs() const
@@ -152,3 +153,13 @@ void TabbedArea::setSelectedTab(gcn::Tab *tab)
if (newTab)
newTab->setCurrent();
}
+
+void TabbedArea::widgetResized(const gcn::Event &event)
+{
+ int width = getWidth() - 2 * getFrameSize();
+ int height = getHeight() - 2 * getFrameSize() - mTabContainer->getHeight();
+ mWidgetContainer->setSize(width, height);
+ gcn::Widget *w = getCurrentWidget();
+ if (w)
+ w->setSize(width, height);
+}