Merge branch 'subtree'
[fanfix.git] / src / jexer / TCheckBox.java
index 9cdb303989a1bc53f547277055f8745b6e7f37e1..1f9a351c0c0c636c538272d372c5a3b4ef43f583 100644 (file)
@@ -34,6 +34,7 @@ import static jexer.TKeypress.kbSpace;
 import jexer.bits.CellAttributes;
 import jexer.bits.GraphicsChars;
 import jexer.bits.MnemonicString;
+import jexer.bits.StringUtils;
 import jexer.event.TKeypressEvent;
 import jexer.event.TMouseEvent;
 
@@ -78,7 +79,7 @@ public class TCheckBox extends TWidget {
         final String label, final boolean checked) {
 
         // Set parent and window
-        super(parent, x, y, label.length() + 4, 1);
+        super(parent, x, y, StringUtils.width(label) + 4, 1);
 
         mnemonic = new MnemonicString(label);
         this.checked = checked;
@@ -175,8 +176,8 @@ public class TCheckBox extends TWidget {
         }
         putCharXY(2, 0, ']', checkboxColor);
         putStringXY(4, 0, mnemonic.getRawLabel(), checkboxColor);
-        if (mnemonic.getShortcutIdx() >= 0) {
-            putCharXY(4 + mnemonic.getShortcutIdx(), 0,
+        if (mnemonic.getScreenShortcutIdx() >= 0) {
+            putCharXY(4 + mnemonic.getScreenShortcutIdx(), 0,
                 mnemonic.getShortcut(), mnemonicColor);
         }
     }