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
README for submodules
[fanfix.git]
/
src
/
jexer
/
ttree
/
TTreeItem.java
diff --git
a/src/jexer/ttree/TTreeItem.java
b/src/jexer/ttree/TTreeItem.java
index 759bfb7a857ff3878c7986c63a26adafb1468f3f..44c408b2bd3f6095bd8a27d758d76b0b233e3964 100644
(file)
--- a/
src/jexer/ttree/TTreeItem.java
+++ b/
src/jexer/ttree/TTreeItem.java
@@
-34,6
+34,7
@@
import java.util.List;
import jexer.TWidget;
import jexer.bits.CellAttributes;
import jexer.bits.GraphicsChars;
import jexer.TWidget;
import jexer.bits.CellAttributes;
import jexer.bits.GraphicsChars;
+import jexer.bits.StringUtils;
import jexer.event.TKeypressEvent;
import jexer.event.TMouseEvent;
import static jexer.TKeypress.*;
import jexer.event.TKeypressEvent;
import jexer.event.TMouseEvent;
import static jexer.TKeypress.*;
@@
-266,9
+267,9
@@
public class TTreeItem extends TWidget {
}
putStringXY(offset, 0, line, color);
if (selected) {
}
putStringXY(offset, 0, line, color);
if (selected) {
- putStringXY(offset +
line.length(
), 0, text, selectedColor);
+ putStringXY(offset +
StringUtils.width(line
), 0, text, selectedColor);
} else {
} else {
- putStringXY(offset +
line.length(
), 0, text, textColor);
+ putStringXY(offset +
StringUtils.width(line
), 0, text, textColor);
}
if ((level > 0) && (expandable)) {
if (expanded) {
}
if ((level > 0) && (expandable)) {
if (expanded) {
@@
-402,10
+403,10
@@
public class TTreeItem extends TWidget {
* @return the maximum number of columns for this item or its children
*/
public int getMaximumColumn() {
* @return the maximum number of columns for this item or its children
*/
public int getMaximumColumn() {
- int max = prefix.length() + 4 +
text.length(
);
+ int max = prefix.length() + 4 +
StringUtils.width(text
);
for (TWidget widget: getChildren()) {
TTreeItem item = (TTreeItem) widget;
for (TWidget widget: getChildren()) {
TTreeItem item = (TTreeItem) widget;
- int n = item.prefix.length() + 4 +
item.text.length(
);
+ int n = item.prefix.length() + 4 +
StringUtils.width(item.text
);
if (n > max) {
max = n;
}
if (n > max) {
max = n;
}