aboutsummaryrefslogtreecommitdiff
path: root/gui/message.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-10-10 08:13:26 +0000
committerTorbjörn Andersson2010-10-10 08:13:26 +0000
commit25dac76b3500c23bf13cce359a59ea184f9cbeeb (patch)
tree3a8fa8d1aae5e06485d67d11c4b7b25a5552d5ed /gui/message.cpp
parentced1aba1eac0e8e7891ad44f09ff0877a4fbb3da (diff)
downloadscummvm-rg350-25dac76b3500c23bf13cce359a59ea184f9cbeeb.tar.gz
scummvm-rg350-25dac76b3500c23bf13cce359a59ea184f9cbeeb.tar.bz2
scummvm-rg350-25dac76b3500c23bf13cce359a59ea184f9cbeeb.zip
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
Diffstat (limited to 'gui/message.cpp')
-rw-r--r--gui/message.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gui/message.cpp b/gui/message.cpp
index 6406976569..198a34eb0d 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -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;