retrofit
[fanfix.git] / src / jexer / TList.java
index a962f7cfe9eeee9b3ed579657964765add8bc772..6b0a205bf422e2bd18cc186f226777d6c0c98084 100644 (file)
@@ -327,6 +327,38 @@ public class TList extends TScrollableWidget {
     // TScrollableWidget ------------------------------------------------------
     // ------------------------------------------------------------------------
 
+    /**
+     * Override TWidget's width: we need to set child widget widths.
+     *
+     * @param width new widget width
+     */
+    @Override
+    public void setWidth(final int width) {
+        super.setWidth(width);
+        if (hScroller != null) {
+            hScroller.setWidth(getWidth() - 1);
+        }
+        if (vScroller != null) {
+            vScroller.setX(getWidth() - 1);
+        }
+    }
+
+    /**
+     * Override TWidget's height: we need to set child widget heights.
+     *
+     * @param height new widget height
+     */
+    @Override
+    public void setHeight(final int height) {
+        super.setHeight(height);
+        if (hScroller != null) {
+            hScroller.setY(getHeight() - 1);
+        }
+        if (vScroller != null) {
+            vScroller.setHeight(getHeight() - 1);
+        }
+    }
+
     /**
      * Resize for a new width/height.
      */
@@ -482,7 +514,7 @@ public class TList extends TScrollableWidget {
         assert (selectedString >= 0);
         assert (selectedString < strings.size());
         if (enterAction != null) {
-            enterAction.DO();
+            enterAction.DO(this);
         }
     }
 
@@ -493,7 +525,7 @@ public class TList extends TScrollableWidget {
         assert (selectedString >= 0);
         assert (selectedString < strings.size());
         if (moveAction != null) {
-            moveAction.DO();
+            moveAction.DO(this);
         }
     }
 
@@ -504,7 +536,7 @@ public class TList extends TScrollableWidget {
         assert (selectedString >= 0);
         assert (selectedString < strings.size());
         if (singleClickAction != null) {
-            singleClickAction.DO();
+            singleClickAction.DO(this);
         }
     }