From b9834fed0218d5cbe31ff5dd36ab139da8623ee2 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 19 Jan 2009 20:36:40 +0100 Subject: Reflowed Joystick tab using layout engine. Signed-off-by: Ira Rice (cherry picked from commit e3f05299f81cd2e567531df6729de0f34970a9e9) Conflicts: src/gui/setup_joystick.cpp --- src/gui/setup_joystick.cpp | 22 ++++++++++++++-------- 1 file 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) -- cgit v1.2.3-70-g09d2