X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fttree%2FTTreeViewWindow.java;h=f418383ecf43d637c14b81cceedd914b44b54179;hb=505be508ae7d3fb48122be548b310a238cfb91eb;hp=2adf61681ab3857e26403da73cd23af0d2f769eb;hpb=d6ee0801333ff93dffd851f4c1a44519c96c371d;p=fanfix.git diff --git a/src/jexer/ttree/TTreeViewWindow.java b/src/jexer/ttree/TTreeViewWindow.java index 2adf616..f418383 100644 --- a/src/jexer/ttree/TTreeViewWindow.java +++ b/src/jexer/ttree/TTreeViewWindow.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.THScroller; import jexer.TScrollableWindow; import jexer.TVScroller; import jexer.TWidget; +import jexer.bits.StringUtils; import jexer.event.TKeypressEvent; import jexer.event.TMouseEvent; import jexer.event.TResizeEvent; @@ -190,6 +191,13 @@ public class TTreeViewWindow extends TScrollableWindow { return; } + // Give the shortcut bar a shot at this. + if (statusBar != null) { + if (statusBar.statusBarKeypress(keypress)) { + return; + } + } + if (keypress.equals(kbShiftLeft) || keypress.equals(kbCtrlLeft) || keypress.equals(kbAltLeft) @@ -294,7 +302,7 @@ public class TTreeViewWindow extends TScrollableWindow { selectedRow++; } - int lineWidth = item.getText().length() + int lineWidth = StringUtils.width(item.getText()) + item.getPrefix().length() + 4; if (lineWidth > maxLineWidth) { maxLineWidth = lineWidth;