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
#46 StretchLayoutManager working
[fanfix.git]
/
src
/
jexer
/
TLabel.java
diff --git
a/src/jexer/TLabel.java
b/src/jexer/TLabel.java
index 75623ffc11ad8ecee95e062d4d0b506a4f63afca..0c62250ec79b3cd3cfa6af0307c34f7caeac8b86 100644
(file)
--- 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.CellAttributes;
import jexer.bits.MnemonicString;
+import jexer.bits.StringUtils;
/**
* TLabel implements a simple label, with an optional mnemonic hotkey action
/**
* 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
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;
mnemonic = new MnemonicString(text);
this.colorKey = colorKey;
@@
-169,6
+170,17
@@
public class TLabel extends TWidget {
// TWidget ----------------------------------------------------------------
// ------------------------------------------------------------------------
// TWidget ----------------------------------------------------------------
// ------------------------------------------------------------------------
+ /**
+ * Override TWidget's height: we can only set height at construction
+ * time.
+ *
+ * @param height new widget height (ignored)
+ */
+ @Override
+ public void setHeight(final int height) {
+ // Do nothing
+ }
+
/**
* Draw a static label.
*/
/**
* Draw a static label.
*/
@@
-185,8
+197,8
@@
public class TLabel extends TWidget {
mnemonicColor.setBackColor(background.getBackColor());
}
putStringXY(0, 0, mnemonic.getRawLabel(), color);
mnemonicColor.setBackColor(background.getBackColor());
}
putStringXY(0, 0, mnemonic.getRawLabel(), color);
- if (mnemonic.getShortcutIdx() >= 0) {
- putCharXY(mnemonic.getShortcutIdx(), 0,
+ if (mnemonic.getS
creenS
hortcutIdx() >= 0) {
+ putCharXY(mnemonic.getS
creenS
hortcutIdx(), 0,
mnemonic.getShortcut(), mnemonicColor);
}
}
mnemonic.getShortcut(), mnemonicColor);
}
}
@@
-225,7
+237,7
@@
public class TLabel extends TWidget {
/**
* Get the label color.
*
/**
* 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;
*/
public String getColorKey() {
return colorKey;