summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-11-01 00:45:22 +0300
committerAndrei Karas <akaras@inbox.ru>2012-11-01 00:45:22 +0300
commit80ab56a4a548cf4a6b340feee4ea48449bafbafd (patch)
tree7ae8c84efa24d1a26b9a127515e09000738e289a
parentf93993dd417e3d88927ac22628aebe976b9ad05f (diff)
downloadmanaverse-80ab56a4a548cf4a6b340feee4ea48449bafbafd.tar.gz
manaverse-80ab56a4a548cf4a6b340feee4ea48449bafbafd.tar.bz2
manaverse-80ab56a4a548cf4a6b340feee4ea48449bafbafd.tar.xz
manaverse-80ab56a4a548cf4a6b340feee4ea48449bafbafd.zip
Fix ok dialog size with small messages.
-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));