From 7d922e0dfd9a6da42b84e01d52adeec6fff10025 Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Tue, 24 Apr 2018 17:56:47 -0400 Subject: [PATCH] #34 call onResize() when window size is changed --- src/jexer/TApplication.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 7f491a5b..96dad6cc 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())); + } } } } -- 2.27.0