X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTCheckBox.java;h=1f9a351c0c0c636c538272d372c5a3b4ef43f583;hb=HEAD;hp=9cdb303989a1bc53f547277055f8745b6e7f37e1;hpb=00691e80f2f135f92be739e2b7e86775a2357276;p=fanfix.git diff --git a/src/jexer/TCheckBox.java b/src/jexer/TCheckBox.java index 9cdb303..1f9a351 100644 --- a/src/jexer/TCheckBox.java +++ b/src/jexer/TCheckBox.java @@ -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); } }