diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-19 20:36:40 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-19 20:36:40 +0100 |
commit | b9834fed0218d5cbe31ff5dd36ab139da8623ee2 (patch) | |
tree | 6a093ba892649d90342d2c0f95d54a8fb4210c9f /src/gui/setup_joystick.cpp | |
parent | 8c826dd4d5ed56826c588734a192977fc3155e49 (diff) | |
download | mana-b9834fed0218d5cbe31ff5dd36ab139da8623ee2.tar.gz mana-b9834fed0218d5cbe31ff5dd36ab139da8623ee2.tar.bz2 mana-b9834fed0218d5cbe31ff5dd36ab139da8623ee2.tar.xz mana-b9834fed0218d5cbe31ff5dd36ab139da8623ee2.zip |
Reflowed Joystick tab using layout engine.
Signed-off-by: Ira Rice <irarice@gmail.com>
(cherry picked from commit e3f05299f81cd2e567531df6729de0f34970a9e9)
Conflicts:
src/gui/setup_joystick.cpp
Diffstat (limited to 'src/gui/setup_joystick.cpp')
-rw-r--r-- | src/gui/setup_joystick.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp index 9de5be9f..ad80a5f4 100644 --- a/src/gui/setup_joystick.cpp +++ b/src/gui/setup_joystick.cpp @@ -25,6 +25,9 @@ #include "button.h" #include "checkbox.h" + +#include "widgets/layouthelper.h" + #include "../configuration.h" #include "../joystick.h" @@ -38,20 +41,23 @@ Setup_Joystick::Setup_Joystick(): mJoystickEnabled(new CheckBox(_("Enable joystick"))) { setOpaque(false); - setDimension(gcn::Rectangle(0, 0, 250, 200)); - - 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, 250, 200)); } void Setup_Joystick::action(const gcn::ActionEvent &event) |