From: Niki Roo Date: Thu, 2 Jan 2020 14:22:13 +0000 (+0100) Subject: TUI: fix not-editable fields X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=c6815053bca27b1c2374548e06779a97651fe07d;p=fanfix-jexer.git TUI: fix not-editable fields --- diff --git a/src/be/nikiroo/fanfix/reader/tui/TSimpleScrollableWindow.java b/src/be/nikiroo/fanfix/reader/tui/TSimpleScrollableWindow.java index 48a225e..f9e7974 100644 --- a/src/be/nikiroo/fanfix/reader/tui/TSimpleScrollableWindow.java +++ b/src/be/nikiroo/fanfix/reader/tui/TSimpleScrollableWindow.java @@ -6,6 +6,7 @@ import jexer.TPanel; import jexer.TScrollableWindow; import jexer.TVScroller; import jexer.TWidget; +import jexer.event.TResizeEvent; public class TSimpleScrollableWindow extends TScrollableWindow { protected TPanel mainPane; @@ -27,7 +28,7 @@ public class TSimpleScrollableWindow extends TScrollableWindow { int width, int height, int flags, int realWidth, int realHeight) { super(application, title, width, height, flags); - mainPane = new TPanel(this, 0, 0, width, 80) { + mainPane = new TPanel(this, 0, 0, 1, 1) { @Override public void draw() { for (TWidget children : mainPane.getChildren()) { @@ -41,10 +42,8 @@ public class TSimpleScrollableWindow extends TScrollableWindow { } }; - // // TODO: test - // for (int i = 0; i < 80; i++) { - // mainPane.addLabel("ligne " + i, i, i); - // } + mainPane.setWidth(getWidth()); + mainPane.setHeight(getHeight()); setRealWidth(realWidth); setRealHeight(realHeight); @@ -93,6 +92,14 @@ public class TSimpleScrollableWindow extends TScrollableWindow { reflowData(); } + @Override + public void onResize(TResizeEvent event) { + super.onResize(event); + mainPane.setWidth(getWidth()); + mainPane.setHeight(getHeight()); + mainPane.onResize(event); + } + @Override public void reflowData() { super.reflowData();