#34 call onResize() when window size is changed
authorKevin Lamonte <kevin.lamonte@gmail.com>
Tue, 24 Apr 2018 21:56:47 +0000 (17:56 -0400)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Tue, 24 Apr 2018 21:56:47 +0000 (17:56 -0400)
src/jexer/TApplication.java

index 7f491a5ba712dad54431dcea705128cc1eab0169..96dad6cc0b0cece1541d43dccab333b813f233d0 100644 (file)
@@ -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()));
+                }
             }
         }
     }