summaryrefslogtreecommitdiff
path: root/src/gui/widgets/container.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-25 22:27:32 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-07-25 22:27:41 +0200
commit8331284990b8d998a7e323e6fcf3c25f2f7d60d8 (patch)
tree168cf7bdc4cc4e8d93c8072ded3c4a1246c12e64 /src/gui/widgets/container.cpp
parentf0d0f33c8fa4910040204ea3023cd08b4660f56f (diff)
downloadmana-8331284990b8d998a7e323e6fcf3c25f2f7d60d8.tar.gz
mana-8331284990b8d998a7e323e6fcf3c25f2f7d60d8.tar.bz2
mana-8331284990b8d998a7e323e6fcf3c25f2f7d60d8.tar.xz
mana-8331284990b8d998a7e323e6fcf3c25f2f7d60d8.zip
Reduced the height of the Setup window
Also removed all the hardcoded sizes of the various setup tabs. Instead, support for dynamically adjusting layout was added to the Container class. Various other places were also adapted to use the new layout support in Container.
Diffstat (limited to 'src/gui/widgets/container.cpp')
-rw-r--r--src/gui/widgets/container.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp
index af4f0155..e1b99af7 100644
--- a/src/gui/widgets/container.cpp
+++ b/src/gui/widgets/container.cpp
@@ -21,7 +21,10 @@
#include "gui/widgets/container.h"
-Container::Container()
+#include "gui/widgets/layouthelper.h"
+
+Container::Container():
+ mLayoutHelper(0)
{
setOpaque(false);
}
@@ -30,4 +33,24 @@ Container::~Container()
{
while (!mWidgets.empty())
delete mWidgets.front();
+
+ delete mLayoutHelper;
+}
+
+Layout &Container::getLayout()
+{
+ if (!mLayoutHelper)
+ mLayoutHelper = new LayoutHelper(this);
+ return mLayoutHelper->getLayout();
+}
+
+LayoutCell &Container::place(int x, int y, gcn::Widget *wg, int w, int h)
+{
+ add(wg);
+ return getLayout().place(wg, x, y, w, h);
+}
+
+ContainerPlacer Container::getPlacer(int x, int y)
+{
+ return ContainerPlacer(this, &getLayout().at(x, y));
}