X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTMessageBox.java;h=6f1e8a69486b05141b085bda4b841ba474aef347;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=c93ad832d06459b925687969327d77d50371a9db;hpb=589c6ce94839d9b4c6144a24cabad8031596c83b;p=fanfix.git diff --git a/src/jexer/TMessageBox.java b/src/jexer/TMessageBox.java index c93ad83..6f1e8a6 100644 --- a/src/jexer/TMessageBox.java +++ b/src/jexer/TMessageBox.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; +import jexer.bits.StringUtils; import jexer.event.TKeypressEvent; import static jexer.TKeypress.*; @@ -187,11 +188,11 @@ public class TMessageBox extends TWindow { // Determine width and height String [] lines = caption.split("\n"); - int width = title.length() + 12; + int width = StringUtils.width(title) + 12; setHeight(6 + lines.length); for (String line: lines) { - if (line.length() + 4 > width) { - width = line.length() + 4; + if (StringUtils.width(line) + 4 > width) { + width = StringUtils.width(line) + 4; } } setWidth(width);