X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fttree%2FTTreeViewWidget.java;h=9ffb72461709645a428886f944a63a55213db006;hb=5dccc93977b5f3cbde6e791404e5e43ae540ff54;hp=adb9a5d8e354b1974d70843e608944e0dd4b5c8b;hpb=d6ee0801333ff93dffd851f4c1a44519c96c371d;p=nikiroo-utils.git diff --git a/src/jexer/ttree/TTreeViewWidget.java b/src/jexer/ttree/TTreeViewWidget.java index adb9a5d..9ffb724 100644 --- a/src/jexer/ttree/TTreeViewWidget.java +++ b/src/jexer/ttree/TTreeViewWidget.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2017 Kevin Lamonte + * Copyright (C) 2019 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -34,6 +34,7 @@ import jexer.TKeypress; import jexer.TScrollableWidget; import jexer.TVScroller; import jexer.TWidget; +import jexer.bits.StringUtils; import jexer.event.TKeypressEvent; import jexer.event.TMouseEvent; import static jexer.TKeypress.*; @@ -279,7 +280,7 @@ public class TTreeViewWidget extends TScrollableWidget { selectedRow++; } - int lineWidth = item.getText().length() + int lineWidth = StringUtils.width(item.getText()) + item.getPrefix().length() + 4; if (lineWidth > maxLineWidth) { maxLineWidth = lineWidth;