From ce455b0e3cd02b6796cab746addd1ff41a6b7ca8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 18 Oct 2012 19:56:54 +0300 Subject: Fix in ok dialog size and button position. --- src/gui/okdialog.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gui/okdialog.cpp b/src/gui/okdialog.cpp index 5a2e39022..b06ba832c 100644 --- a/src/gui/okdialog.cpp +++ b/src/gui/okdialog.cpp @@ -59,14 +59,13 @@ OkDialog::OkDialog(const std::string &title, const std::string &msg, if (width < okButton->getWidth()) width = okButton->getWidth(); - width = mTextBox->getWidth() + fontHeight; - setContentSize(width, height + fontHeight + okButton->getHeight()); - mTextBox->setPosition(getPadding(), getPadding()); + width = mTextBox->getWidth(); + setContentSize(width, mTextBox->getHeight() + okButton->getHeight() + + getOption("buttonPadding", 8)); + mTextBox->setPosition(0, 0); - // 8 is the padding that GUIChan adds to button widgets - // (top and bottom combined) okButton->setPosition((width - okButton->getWidth()) / 2, - height + getOption("buttonPadding", 8)); + mTextBox->getHeight() + getOption("buttonPadding", 8)); add(mTextBox); add(okButton); -- cgit v1.2.3-70-g09d2