From: Kevin Lamonte Date: Tue, 24 Apr 2018 21:56:47 +0000 (-0400) Subject: #34 call onResize() when window size is changed X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=7d922e0dfd9a6da42b84e01d52adeec6fff10025;p=fanfix-jexer.git #34 call onResize() when window size is changed --- diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 7f491a5..96dad6c 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -2063,6 +2063,9 @@ public class TApplication implements Runnable { } TWindow w = sorted.get(i); + int oldWidth = w.getWidth(); + int oldHeight = w.getHeight(); + w.setX(logicalX * newWidth); w.setWidth(newWidth); if (i >= ((a - 1) * b)) { @@ -2072,6 +2075,12 @@ public class TApplication implements Runnable { w.setY((logicalY * newHeight1) + 1); w.setHeight(newHeight1); } + if ((w.getWidth() != oldWidth) + || (w.getHeight() != oldHeight) + ) { + w.onResize(new TResizeEvent(TResizeEvent.Type.WIDGET, + w.getWidth(), w.getHeight())); + } } } }