summaryrefslogtreecommitdiff
path: root/src/gui/ok_dialog.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 16:51:00 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 16:51:00 +0000
commit9ab399906e9c6ba2d6e029b1d8be50bd1df70ed4 (patch)
tree325486399e3859098f20fbe83a47276fdf01a130 /src/gui/ok_dialog.cpp
parentee416a5f3de03a689247a290077e7fdf451e1a23 (diff)
downloadmana-client-9ab399906e9c6ba2d6e029b1d8be50bd1df70ed4.tar.gz
mana-client-9ab399906e9c6ba2d6e029b1d8be50bd1df70ed4.tar.bz2
mana-client-9ab399906e9c6ba2d6e029b1d8be50bd1df70ed4.tar.xz
mana-client-9ab399906e9c6ba2d6e029b1d8be50bd1df70ed4.zip
Some improvements to character creation and selection dialogs.
Diffstat (limited to 'src/gui/ok_dialog.cpp')
-rw-r--r--src/gui/ok_dialog.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp
index 887c09f7..fa704ecc 100644
--- a/src/gui/ok_dialog.cpp
+++ b/src/gui/ok_dialog.cpp
@@ -29,12 +29,21 @@ OkDialog::OkDialog(const std::string& title, const std::string& msg):
{
userLabel = new gcn::Label(msg);
okButton = new Button("OK");
-
- setSize(200, 80);
- userLabel->setPosition(4, 11);
- okButton->setPosition(120, 52);
- okButton->setEventId("ok");
-
+
+ int w = userLabel->getWidth() + 20;
+ int h = userLabel->getHeight() + 25 + okButton->getHeight();
+
+ if (okButton->getWidth() + 10 > w) {
+ w = okButton->getWidth() + 10;
+ }
+
+ setSize(w, h);
+ userLabel->setPosition(10, 10);
+ okButton->setPosition(
+ (w - okButton->getWidth()) / 2,
+ h - 5 - okButton->getHeight());
+
+ okButton->setEventId("ok");
okButton->addActionListener(this);
add(userLabel);
@@ -53,7 +62,6 @@ OkDialog::~OkDialog()
void OkDialog::action(const std::string& eventId)
{
if (eventId == "ok") {
- //getParent()->remove(this);
windowContainer->scheduleDelete(this);
}
}