From 9af6e761373f25b56e815f1f75b44473474cf280 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 10 Aug 2009 20:28:23 -0600 Subject: 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. --- src/gui/widgets/tabbedarea.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/widgets/tabbedarea.cpp') 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); +} -- cgit v1.2.3-70-g09d2