X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWindow.java;h=2855209eda870bb5a5bc44c9d2670585f7400d89;hb=ba71ae78a66c9f88237d2681aa5ff991e3bd60ef;hp=3f860d636cac5db22e3454f0661acb3efe5ae4e6;hpb=c88c4ced6e9392a53030a1c680fe114931a1a928;p=fanfix.git diff --git a/src/jexer/TWindow.java b/src/jexer/TWindow.java index 3f860d6..2855209 100644 --- a/src/jexer/TWindow.java +++ b/src/jexer/TWindow.java @@ -34,6 +34,7 @@ import java.util.Set; import jexer.backend.Screen; import jexer.bits.CellAttributes; import jexer.bits.GraphicsChars; +import jexer.bits.StringUtils; import jexer.event.TCommandEvent; import jexer.event.TKeypressEvent; import jexer.event.TMenuEvent; @@ -886,10 +887,11 @@ public class TWindow extends TWidget { true); // Draw the title - int titleLeft = (getWidth() - title.length() - 2) / 2; + int titleLength = StringUtils.width(title); + int titleLeft = (getWidth() - titleLength - 2) / 2; putCharXY(titleLeft, 0, ' ', border); - putStringXY(titleLeft + 1, 0, title); - putCharXY(titleLeft + title.length() + 1, 0, ' ', border); + putStringXY(titleLeft + 1, 0, title, border); + putCharXY(titleLeft + titleLength + 1, 0, ' ', border); if (isActive()) { @@ -1186,6 +1188,7 @@ public class TWindow extends TWidget { /** * Activate window (bring to top and receive events). */ + @Override public void activate() { application.activateWindow(this); } @@ -1381,7 +1384,7 @@ public class TWindow extends TWidget { * @return true if this window does not want the application-wide mouse * cursor drawn over it */ - public final boolean hasHiddenMouse() { + public boolean hasHiddenMouse() { return hideMouse; }