git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'subtree'
[fanfix.git]
/
src
/
jexer
/
TLabel.java
diff --git
a/src/jexer/TLabel.java
b/src/jexer/TLabel.java
index f34a533eb8ffb44c1d2aa9ebefc2a2e925a89a66..cc341cfa862964ed9097c425ea4d10b55627ac0c 100644
(file)
--- a/
src/jexer/TLabel.java
+++ b/
src/jexer/TLabel.java
@@
-158,9
+158,9
@@
public class TLabel extends TWidget {
final TAction action) {
// Set parent and window
final TAction action) {
// Set parent and window
- super(parent, false, x, y,
StringUtils.width(text)
, 1);
+ super(parent, false, x, y,
0
, 1);
-
mnemonic = new MnemonicString
(text);
+
setLabel
(text);
this.colorKey = colorKey;
this.useWindowBackground = useWindowBackground;
this.action = action;
this.colorKey = colorKey;
this.useWindowBackground = useWindowBackground;
this.action = action;
@@
-170,6
+170,16
@@
public class TLabel extends TWidget {
// TWidget ----------------------------------------------------------------
// ------------------------------------------------------------------------
// TWidget ----------------------------------------------------------------
// ------------------------------------------------------------------------
+ /**
+ * Override TWidget's width: we can only set width at construction time.
+ *
+ * @param width new widget width (ignored)
+ */
+ @Override
+ public void setWidth(final int width) {
+ // Do nothing
+ }
+
/**
* Override TWidget's height: we can only set height at construction
* time.
/**
* Override TWidget's height: we can only set height at construction
* time.
@@
-232,6
+242,7
@@
public class TLabel extends TWidget {
*/
public void setLabel(final String label) {
mnemonic = new MnemonicString(label);
*/
public void setLabel(final String label) {
mnemonic = new MnemonicString(label);
+ super.setWidth(StringUtils.width(mnemonic.getRawLabel()));
}
/**
}
/**