summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-08-16 18:25:55 +0200
committerPhilipp Sehmisch <crush@themanaworld.org>2009-08-16 18:25:55 +0200
commit4263962e947b4914de8d1750f21cc7cc82567b4d (patch)
tree32340098913c302fdb33f88ffea65fb36920db75 /src/gui/widgets/tabbedarea.cpp
parentdd0844b6ac01293e7afd0dd85e695b8d77b8e4be (diff)
parent7e2673a3b9460fdcd646e23c3bd9039de854565f (diff)
downloadmana-client-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.gz
mana-client-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.bz2
mana-client-4263962e947b4914de8d1750f21cc7cc82567b4d.tar.xz
mana-client-4263962e947b4914de8d1750f21cc7cc82567b4d.zip
More merges and conflict resolves
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index bb5ae9a4..13bb884b 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
@@ -79,6 +80,15 @@ gcn::Widget *TabbedArea::getCurrentWidget()
return NULL;
}
+void TabbedArea::addTab(gcn::Tab* tab, gcn::Widget* widget)
+{
+ gcn::TabbedArea::addTab(tab, widget);
+
+ int width = getWidth() - 2 * getFrameSize();
+ int height = getHeight() - 2 * getFrameSize() - mTabContainer->getHeight();
+ widget->setSize(width, height);
+}
+
void TabbedArea::addTab(const std::string &caption, gcn::Widget *widget)
{
Tab *tab = new Tab;
@@ -152,3 +162,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);
+}