X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTTerminalWindow.java;h=0b653554e0bf8aaee31932f2f6ff84645664e39f;hb=f46a119f4a8694eb680010bb2020cb2791a366eb;hp=34e7dc411d298af3612af465b641db1e95547e83;hpb=2bc32111fa17ae50a8aaa09ab347191fefc494a1;p=fanfix.git diff --git a/src/jexer/TTerminalWindow.java b/src/jexer/TTerminalWindow.java index 34e7dc4..0b65355 100644 --- a/src/jexer/TTerminalWindow.java +++ b/src/jexer/TTerminalWindow.java @@ -153,6 +153,9 @@ public class TTerminalWindow extends TScrollableWindow { super(application, i18n.getString("windowTitle"), x, y, 80 + 2, 24 + 2, flags); + // Require at least one line for the display. + setMinimumWindowHeight(3); + this.closeOnExit = closeOnExit; vScroller = new TVScroller(this, getWidth() - 2, 0, getHeight() - 2); @@ -202,6 +205,9 @@ public class TTerminalWindow extends TScrollableWindow { super(application, i18n.getString("windowTitle"), x, y, 80 + 2, 24 + 2, flags); + // Require at least one line for the display. + setMinimumWindowHeight(3); + this.closeOnExit = closeOnExit; vScroller = new TVScroller(this, getWidth() - 2, 0, getHeight() - 2); @@ -308,6 +314,11 @@ public class TTerminalWindow extends TScrollableWindow { } super.onMouseUp(mouse); + + if (mouse.isMouse1() && mouseOnVerticalScroller(mouse)) { + // Clicked on vertical scrollbar + terminal.setVerticalValue(getVerticalValue()); + } } /** @@ -324,6 +335,11 @@ public class TTerminalWindow extends TScrollableWindow { } super.onMouseMotion(mouse); + + if (mouse.isMouse1() && mouseOnVerticalScroller(mouse)) { + // Clicked/dragged on vertical scrollbar + terminal.setVerticalValue(getVerticalValue()); + } } // ------------------------------------------------------------------------