summaryrefslogtreecommitdiff
path: root/src/gui/char_select.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-07 23:06:24 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-07 23:06:24 +0100
commitd9a77ca6c6c74e0333079208da0d04117f70e48c (patch)
tree61f2acf5df5dd9a2d2524fdf8740f8e38a6bbe99 /src/gui/char_select.cpp
parentdfd31a12ae8a8d44b622b6aa2cd922fca18edf37 (diff)
downloadmana-client-d9a77ca6c6c74e0333079208da0d04117f70e48c.tar.gz
mana-client-d9a77ca6c6c74e0333079208da0d04117f70e48c.tar.bz2
mana-client-d9a77ca6c6c74e0333079208da0d04117f70e48c.tar.xz
mana-client-d9a77ca6c6c74e0333079208da0d04117f70e48c.zip
Used layout manager for character selection dialog
Based on the layout from the mainline client done by Guillaume Melquiond in commits aab0b1724897e186d2d4056da7f0cd34ccc12fcb and 97bbe57e21a28544646da087e2a522390bf2ce5c. Fixes hidden Ok button on many translations.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r--src/gui/char_select.cpp53
1 files changed, 20 insertions, 33 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 65dafeea..643a598f 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -31,6 +31,8 @@
#include "playerbox.h"
#include "textfield.h"
+#include "widgets/layout.h"
+
#include "../game.h"
#include "../localplayer.h"
#include "../main.h"
@@ -93,39 +95,24 @@ CharSelectDialog::CharSelectDialog(Network *network,
// Control that shows the Player
mPlayerBox = new PlayerBox;
-
- int w = 195;
- int h = 220;
- setContentSize(w, h);
- mPlayerBox->setDimension(gcn::Rectangle(5, 5, w - 10, 90));
- mNameLabel->setDimension(gcn::Rectangle(10, 100, 128, 16));
- mLevelLabel->setDimension(gcn::Rectangle(10, 116, 128, 16));
- mJobLevelLabel->setDimension(gcn::Rectangle(10, 132, 128, 16));
- mMoneyLabel->setDimension(gcn::Rectangle(10, 148, 128, 16));
- mPreviousButton->setPosition(5, 170);
- mNextButton->setPosition(mPreviousButton->getWidth() + 10, 170);
- mNewCharButton->setPosition(5, h - 5 - mNewCharButton->getHeight());
- mDelCharButton->setPosition(
- 5 + mNewCharButton->getWidth() + 5,
- mNewCharButton->getY());
- mCancelButton->setPosition(
- w - 5 - mCancelButton->getWidth(),
- mNewCharButton->getY());
- mSelectButton->setPosition(
- mCancelButton->getX() - 5 - mSelectButton->getWidth(),
- mNewCharButton->getY());
-
- add(mPlayerBox);
- add(mSelectButton);
- add(mCancelButton);
- add(mNewCharButton);
- add(mDelCharButton);
- add(mPreviousButton);
- add(mNextButton);
- add(mNameLabel);
- add(mLevelLabel);
- add(mJobLevelLabel);
- add(mMoneyLabel);
+ mPlayerBox->setWidth(74);
+
+ ContainerPlacer place;
+ place = getPlacer(0, 0);
+ place(0, 0, mPlayerBox, 1, 6).setPadding(3);
+ place(1, 0, mNameLabel, 3);
+ place(1, 1, mLevelLabel, 3);
+ place(1, 2, mJobLevelLabel, 3);
+ place(1, 3, mMoneyLabel, 3);
+ place(1, 4, mPreviousButton);
+ place(2, 4, mNextButton);
+ place(1, 5, mNewCharButton);
+ place(2, 5, mDelCharButton);
+ place.getCell().matchColWidth(1, 2);
+ place = getPlacer(0, 2);
+ place(0, 0, mSelectButton);
+ place(1, 0, mCancelButton);
+ reflowLayout(265, 0);
setLocationRelativeTo(getParent());
setVisible(true);