GUI: Ensure that the message dialog is wide enough

The Hugo engine currently uses the message dialog. Make sure that
the dialog is always at least wide enough to hold the "Ok" button.

svn-id: r53107
This commit is contained in:
Torbjörn Andersson 2010-10-10 08:13:26 +00:00
parent ced1aba1ea
commit 25dac76b35

View File

@ -58,7 +58,10 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB
int maxlineWidth = g_gui.getFont().wordWrapText(message, screenW - 2 * 20, lines);
// Calculate the desired dialog size (maxing out at 300*180 for now)
_w = maxlineWidth + 20;
if (maxlineWidth > buttonWidth)
_w = maxlineWidth + 20;
else
_w = buttonWidth + 20;
lineCount = lines.size();
_h = 16;