From ec7fcc9e2029b9b57acb5bfae25faa7b95e19412 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 19 Jan 2009 20:25:19 +0100 Subject: Reflowed the setup keyboard tab with the layout code. Signed-off-by: Ira Rice (cherry picked from commit 8f28b18a31fc8415fbf6aedc5106b8b8525f4caf) Conflicts: src/gui/setup_keyboard.cpp src/gui/setup_video.cpp --- src/gui/setup_keyboard.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp index e4d1af0c..af6bebae 100644 --- a/src/gui/setup_keyboard.cpp +++ b/src/gui/setup_keyboard.cpp @@ -29,6 +29,8 @@ #include "ok_dialog.h" #include "scrollarea.h" +#include "widgets/layouthelper.h" + #include "../configuration.h" #include "../keyboardconfig.h" @@ -74,7 +76,6 @@ Setup_Keyboard::Setup_Keyboard(): { keyboard.setSetupKeyboard(this); setOpaque(false); - setDimension(gcn::Rectangle(0, 0, 250, 200)); refreshKeys(); @@ -83,19 +84,23 @@ Setup_Keyboard::Setup_Keyboard(): mKeyList->setSelected(-1); ScrollArea *scrollArea = new ScrollArea(mKeyList); - scrollArea->setDimension(gcn::Rectangle(10, 10, 200, 140)); - add(scrollArea); mAssignKeyButton = new Button(_("Assign"), "assign", this); - mAssignKeyButton->setPosition(165, 155); mAssignKeyButton->addActionListener(this); mAssignKeyButton->setEnabled(false); - add(mAssignKeyButton); mMakeDefaultButton = new Button(_("Default"), "makeDefault", this); - mMakeDefaultButton->setPosition(10, 155); mMakeDefaultButton->addActionListener(this); - add(mMakeDefaultButton); + + // Do the layout + LayoutHelper h(this); + ContainerPlacer place = h.getPlacer(0, 0); + + place(0, 0, scrollArea, 4, 6).setPadding(2); + place(0, 6, mMakeDefaultButton); + place(3, 6, mAssignKeyButton); + + setDimension(gcn::Rectangle(0, 0, 250, 200)); } Setup_Keyboard::~Setup_Keyboard() -- cgit v1.2.3-70-g09d2