X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTLabel.java;h=38c014c26ea256441d37bb2a03c88417c49fd8c1;hb=6cdd4553f20b84586df10e5f8319b6462bf3bd41;hp=75623ffc11ad8ecee95e062d4d0b506a4f63afca;hpb=1dac6b8d395e2bf3c1b58915f8f4f481d9e46793;p=fanfix.git diff --git a/src/jexer/TLabel.java b/src/jexer/TLabel.java index 75623ff..38c014c 100644 --- a/src/jexer/TLabel.java +++ b/src/jexer/TLabel.java @@ -30,6 +30,7 @@ package jexer; import jexer.bits.CellAttributes; import jexer.bits.MnemonicString; +import jexer.bits.StringUtils; /** * TLabel implements a simple label, with an optional mnemonic hotkey action @@ -157,7 +158,7 @@ public class TLabel extends TWidget { final TAction action) { // Set parent and window - super(parent, false, x, y, text.length(), 1); + super(parent, false, x, y, StringUtils.width(text), 1); mnemonic = new MnemonicString(text); this.colorKey = colorKey; @@ -185,8 +186,8 @@ public class TLabel extends TWidget { mnemonicColor.setBackColor(background.getBackColor()); } putStringXY(0, 0, mnemonic.getRawLabel(), color); - if (mnemonic.getShortcutIdx() >= 0) { - putCharXY(mnemonic.getShortcutIdx(), 0, + if (mnemonic.getScreenShortcutIdx() >= 0) { + putCharXY(mnemonic.getScreenShortcutIdx(), 0, mnemonic.getShortcut(), mnemonicColor); } } @@ -225,7 +226,7 @@ public class TLabel extends TWidget { /** * Get the label color. * - * @param return the ColorTheme key color to use for foreground text + * @return the ColorTheme key color to use for foreground text */ public String getColorKey() { return colorKey;