summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/okdialog.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/okdialog.cpp b/src/gui/okdialog.cpp
index 0a0c32baa..5d0f2a01f 100644
--- a/src/gui/okdialog.cpp
+++ b/src/gui/okdialog.cpp
@@ -56,11 +56,13 @@ OkDialog::OkDialog(const std::string &title, const std::string &msg,
if (width < okButton->getWidth())
width = okButton->getWidth();
- width = mTextBox->getWidth();
+ if (mTextBox->getWidth() > width)
+ width = mTextBox->getWidth();
+ if (okButton->getWidth() > width)
+ width = okButton->getWidth();
setContentSize(width, mTextBox->getHeight() + okButton->getHeight()
+ getOption("buttonPadding", 8));
- mTextBox->setPosition(0, 0);
-
+ mTextBox->setPosition((width - mTextBox->getWidth()) / 2, 0);
okButton->setPosition((width - okButton->getWidth()) / 2,
mTextBox->getHeight() + getOption("buttonPadding", 8));