summaryrefslogtreecommitdiff
path: root/src/gui/quitdialog.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2009-11-23 20:51:43 +0100
committerJared Adams <jaxad0127@gmail.com>2009-11-23 14:20:01 -0700
commit1d5a5c6d4d1125a57c60058cf9c1e49633236f32 (patch)
treee95b1d865d82f5c628628d9c1cfc598d3d946995 /src/gui/quitdialog.cpp
parentf4a8b7c6ebf09fa30e88c713c4dda34de7ce8444 (diff)
downloadmana-1d5a5c6d4d1125a57c60058cf9c1e49633236f32.tar.gz
mana-1d5a5c6d4d1125a57c60058cf9c1e49633236f32.tar.bz2
mana-1d5a5c6d4d1125a57c60058cf9c1e49633236f32.tar.xz
mana-1d5a5c6d4d1125a57c60058cf9c1e49633236f32.zip
Fixing the overlapping widgets in quitdialog.
Diffstat (limited to 'src/gui/quitdialog.cpp')
-rw-r--r--src/gui/quitdialog.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp
index 4a5cfe33..c7448f7c 100644
--- a/src/gui/quitdialog.cpp
+++ b/src/gui/quitdialog.cpp
@@ -23,6 +23,7 @@
#include "main.h"
+#include "gui/widgets/layout.h"
#include "gui/widgets/button.h"
#include "gui/widgets/radiobutton.h"
@@ -36,28 +37,15 @@
QuitDialog::QuitDialog(QuitDialog** pointerToMe):
Window(_("Quit"), true, NULL), mMyPointer(pointerToMe)
{
+ ContainerPlacer place = getPlacer(0, 0);
- mLogoutQuit = new RadioButton(_("Quit"), "quitdialog");
mForceQuit = new RadioButton(_("Quit"), "quitdialog");
+ mLogoutQuit = new RadioButton(_("Quit"), "quitdialog");
mSwitchAccountServer = new RadioButton(_("Switch server"), "quitdialog");
mSwitchCharacter = new RadioButton(_("Switch character"), "quitdialog");
mOkButton = new Button(_("OK"), "ok", this);
mCancelButton = new Button(_("Cancel"), "cancel", this);
- setContentSize(200, 91);
-
- mLogoutQuit->setPosition(5, 5);
- mForceQuit->setPosition(5, 5);
- mSwitchAccountServer->setPosition(5, 14 + mLogoutQuit->getHeight());
- mSwitchCharacter->setPosition(5,
- 23 + mLogoutQuit->getHeight() + mSwitchAccountServer->getHeight());
- mCancelButton->setPosition(
- 200 - mCancelButton->getWidth() - 5,
- 91 - mCancelButton->getHeight() - 5);
- mOkButton->setPosition(
- mCancelButton->getX() - mOkButton->getWidth() - 5,
- 91 - mOkButton->getHeight() - 5);
-
//All states, when we're not logged in to someone.
if (state == STATE_CHOOSE_SERVER ||
state == STATE_CONNECT_SERVER ||
@@ -66,26 +54,26 @@ QuitDialog::QuitDialog(QuitDialog** pointerToMe):
state == STATE_UPDATE ||
state == STATE_LOAD_DATA)
{
+ place(0, 0, mForceQuit, 3);
mForceQuit->setSelected(true);
- add(mForceQuit);
}
else
{
// Only added if we are connected to an accountserver or gameserver
+ place(0, 0, mLogoutQuit, 3);
+ place(0, 1, mSwitchAccountServer, 3);
mLogoutQuit->setSelected(true);
- add(mLogoutQuit);
- add(mSwitchAccountServer);
// Only added if we are connected to a gameserver
- if (state == STATE_GAME) add(mSwitchCharacter);
+ if (state == STATE_GAME) place(0, 2, mSwitchCharacter, 3);
}
- add(mOkButton);
- add(mCancelButton);
+ place(1, 3, mOkButton);
+ place(2, 3, mCancelButton);
+ reflowLayout(150, 0);
setLocationRelativeTo(getParent());
setVisible(true);
-
mOkButton->requestFocus();
}