X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTButton.java;h=82a638922df56ed7ad6086fcfd5ba4aff385e28f;hb=3fe82fa71d39d874691dc85e6a77250fd4953b17;hp=33fe73328b1773f9b42225537a70771fc8c8b6d6;hpb=a39c5665a6cd98ce87de4075962b1af9dd53aa25;p=fanfix.git diff --git a/src/jexer/TButton.java b/src/jexer/TButton.java index 33fe733..82a6389 100644 --- a/src/jexer/TButton.java +++ b/src/jexer/TButton.java @@ -32,6 +32,7 @@ import jexer.bits.CellAttributes; import jexer.bits.Color; import jexer.bits.GraphicsChars; import jexer.bits.MnemonicString; +import jexer.bits.StringUtils; import jexer.event.TKeypressEvent; import jexer.event.TMouseEvent; import static jexer.TKeypress.kbEnter; @@ -98,7 +99,7 @@ public class TButton extends TWidget { setX(x); setY(y); setHeight(2); - setWidth(mnemonic.getRawLabel().length() + 3); + setWidth(StringUtils.width(mnemonic.getRawLabel()) + 3); shadowColor = new CellAttributes(); shadowColor.setTo(getWindow().getBackground()); @@ -249,12 +250,12 @@ public class TButton extends TWidget { GraphicsChars.CP437[0xDF], shadowColor); } } - if (mnemonic.getShortcutIdx() >= 0) { + if (mnemonic.getScreenShortcutIdx() >= 0) { if (inButtonPress) { - putCharXY(2 + mnemonic.getShortcutIdx(), 0, + putCharXY(2 + mnemonic.getScreenShortcutIdx(), 0, mnemonic.getShortcut(), menuMnemonicColor); } else { - putCharXY(1 + mnemonic.getShortcutIdx(), 0, + putCharXY(1 + mnemonic.getScreenShortcutIdx(), 0, mnemonic.getShortcut(), menuMnemonicColor); } }