hideStatusBar and hideMenuBar
[fanfix.git] / src / jexer / TWindow.java
index b8513c44298e01819e12d2cf5dbf07a18a1bdd02..20f88d6da388500154b25fa0e91e7e76611871b7 100644 (file)
@@ -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()) {
 
@@ -1122,9 +1124,9 @@ public class TWindow extends TWidget {
         restoreWindowX = getX();
         restoreWindowY = getY();
         setWidth(getScreen().getWidth());
-        setHeight(application.getDesktopBottom() - 1);
+        setHeight(application.getDesktopBottom() - application.getDesktopTop());
         setX(0);
-        setY(1);
+        setY(application.getDesktopTop());
         maximized = true;
 
         onResize(new TResizeEvent(TResizeEvent.Type.WIDGET, getWidth(),
@@ -1382,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;
     }