diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-07-25 22:27:32 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-08-05 17:16:58 +0200 |
commit | 542570896e1e0ce73ebfc442b48e741c2ea32377 (patch) | |
tree | 834b0f9c87d2aa73d22a004a103d8e615ee6d9ba /src/gui/widgets/container.cpp | |
parent | 1fe16bdda5fa0d7112f4568e7bcd892d01c197b9 (diff) | |
download | mana-client-542570896e1e0ce73ebfc442b48e741c2ea32377.tar.gz mana-client-542570896e1e0ce73ebfc442b48e741c2ea32377.tar.bz2 mana-client-542570896e1e0ce73ebfc442b48e741c2ea32377.tar.xz mana-client-542570896e1e0ce73ebfc442b48e741c2ea32377.zip |
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.
Reviewed-by: Erik Schilling
Diffstat (limited to 'src/gui/widgets/container.cpp')
-rw-r--r-- | src/gui/widgets/container.cpp | 25 |
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)); } |