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
/
TCheckBox.java
diff --git
a/src/jexer/TCheckBox.java
b/src/jexer/TCheckBox.java
index 9cdb303989a1bc53f547277055f8745b6e7f37e1..1f9a351c0c0c636c538272d372c5a3b4ef43f583 100644
(file)
--- a/
src/jexer/TCheckBox.java
+++ b/
src/jexer/TCheckBox.java
@@
-34,6
+34,7
@@
import static jexer.TKeypress.kbSpace;
import jexer.bits.CellAttributes;
import jexer.bits.GraphicsChars;
import jexer.bits.MnemonicString;
import jexer.bits.CellAttributes;
import jexer.bits.GraphicsChars;
import jexer.bits.MnemonicString;
+import jexer.bits.StringUtils;
import jexer.event.TKeypressEvent;
import jexer.event.TMouseEvent;
import jexer.event.TKeypressEvent;
import jexer.event.TMouseEvent;
@@
-78,7
+79,7
@@
public class TCheckBox extends TWidget {
final String label, final boolean checked) {
// Set parent and window
final String label, final boolean checked) {
// Set parent and window
- super(parent, x, y,
label.length(
) + 4, 1);
+ super(parent, x, y,
StringUtils.width(label
) + 4, 1);
mnemonic = new MnemonicString(label);
this.checked = checked;
mnemonic = new MnemonicString(label);
this.checked = checked;
@@
-175,8
+176,8
@@
public class TCheckBox extends TWidget {
}
putCharXY(2, 0, ']', checkboxColor);
putStringXY(4, 0, mnemonic.getRawLabel(), checkboxColor);
}
putCharXY(2, 0, ']', checkboxColor);
putStringXY(4, 0, mnemonic.getRawLabel(), checkboxColor);
- if (mnemonic.getShortcutIdx() >= 0) {
- putCharXY(4 + mnemonic.getShortcutIdx(), 0,
+ if (mnemonic.getS
creenS
hortcutIdx() >= 0) {
+ putCharXY(4 + mnemonic.getS
creenS
hortcutIdx(), 0,
mnemonic.getShortcut(), mnemonicColor);
}
}
mnemonic.getShortcut(), mnemonicColor);
}
}