diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-18 23:40:12 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-18 23:40:12 -0700 |
commit | e3f05299f81cd2e567531df6729de0f34970a9e9 (patch) | |
tree | 95204688fee80e437a0a3deae8807a00eb4a78ef /src | |
parent | 18c00fedebda79d4ebfbe15401c3e5bc8869fda2 (diff) | |
download | mana-e3f05299f81cd2e567531df6729de0f34970a9e9.tar.gz mana-e3f05299f81cd2e567531df6729de0f34970a9e9.tar.bz2 mana-e3f05299f81cd2e567531df6729de0f34970a9e9.tar.xz mana-e3f05299f81cd2e567531df6729de0f34970a9e9.zip |
Reflowed Joystick tab using layout engine.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/setup_joystick.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp index 1457bc2f..2411eebc 100644 --- a/src/gui/setup_joystick.cpp +++ b/src/gui/setup_joystick.cpp @@ -25,6 +25,8 @@ #include "checkbox.h" #include "setup_joystick.h" +#include "widgets/layouthelper.h" + #include "../configuration.h" #include "../joystick.h" @@ -38,20 +40,23 @@ Setup_Joystick::Setup_Joystick(): mJoystickEnabled(new CheckBox(_("Enable joystick"))) { setOpaque(false); - setDimension(gcn::Rectangle(0, 0, 290, 255)); - - mJoystickEnabled->setPosition(10, 10); - mCalibrateLabel->setPosition(10, 25); - mCalibrateButton->setPosition(10, 30 + mCalibrateLabel->getHeight()); mOriginalJoystickEnabled = (int)config.getValue("joystickEnabled", 0) != 0; mJoystickEnabled->setSelected(mOriginalJoystickEnabled); mJoystickEnabled->addActionListener(this); - add(mCalibrateLabel); - add(mCalibrateButton); - add(mJoystickEnabled); + // Do the layout + LayoutHelper h(this); + ContainerPlacer place = h.getPlacer(0, 0); + + place(0, 0, mJoystickEnabled); + place(0, 1, mCalibrateLabel); + place.getCell().matchColWidth(0, 0); + place = h.getPlacer(0, 1); + place(0, 0, mCalibrateButton); + + setDimension(gcn::Rectangle(0, 0, 290, 75)); } void Setup_Joystick::action(const gcn::ActionEvent &event) |