X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTLabel.java;h=1d65976bba16f3947a3c47498cf552dcdda4f849;hb=772b8255e4ee92c9c026bd94df39d0c177d6a6bb;hp=f33a8d75f51ac7f6045f3dbc6b8d97934157af2d;hpb=00691e80f2f135f92be739e2b7e86775a2357276;p=fanfix.git diff --git a/src/jexer/TLabel.java b/src/jexer/TLabel.java index f33a8d7..1d65976 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; @@ -222,6 +223,24 @@ public class TLabel extends TWidget { mnemonic = new MnemonicString(label); } + /** + * Get the label color. + * + * @return the ColorTheme key color to use for foreground text + */ + public String getColorKey() { + return colorKey; + } + + /** + * Set the label color. + * + * @param colorKey ColorTheme key color to use for foreground text + */ + public void setColorKey(final String colorKey) { + this.colorKey = colorKey; + } + /** * Act as though the mnemonic shortcut was pressed. */