X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjexer%2FTBrowsableWidget.java;h=44fa7105e9bfc55a3eab68c13916e87d5d455a45;hb=9991e4e10cd1cb607210ecfda9ed48232574be21;hp=aa18d0977ac08bceb1dcebbf7a0bd6a64cffd24a;hpb=d5a3b60634af7e3cbd0b698e6369072751ee1518;p=fanfix.git diff --git a/src/be/nikiroo/jexer/TBrowsableWidget.java b/src/be/nikiroo/jexer/TBrowsableWidget.java index aa18d09..44fa710 100644 --- a/src/be/nikiroo/jexer/TBrowsableWidget.java +++ b/src/be/nikiroo/jexer/TBrowsableWidget.java @@ -24,7 +24,7 @@ * DEALINGS IN THE SOFTWARE. * * @author David ROULET [niki@nikiroo.be] - * @version 1 + * @version 2 */ package be.nikiroo.jexer; @@ -386,19 +386,33 @@ abstract public class TBrowsableWidget extends TScrollableWidget { } private void fixScrollers() { - vScroller.setX(Math.max(0, getWidth() - 3)); - vScroller.setHeight(Math.max(1, getHeight() - 2)); - hScroller.setY(Math.max(0, getHeight() - 3)); - hScroller.setWidth(Math.max(1, getWidth() - 3)); + int width = getWidth() - 1; // vertical prio + int height = getHeight(); - // virtual_size - // - the other scroll bar size + // TODO: why did we do that before? + if (false) { + width -= 2; + height = -1; + } + + int x = Math.max(0, width); + int y = Math.max(0, height - 1); + + vScroller.setX(x); + vScroller.setHeight(height); + hScroller.setY(y); + hScroller.setWidth(width); + + // TODO why did we use to add 2? // + 2 (for the border of the window) + + // virtual_size + // + the other scroll bar size vScroller.setTopValue(0); vScroller.setBottomValue(Math.max(0, getVirtualHeight() - getHeight() - + hScroller.getHeight() + 2)); + + hScroller.getHeight())); hScroller.setLeftValue(0); hScroller.setRightValue(Math.max(0, getVirtualWidth() - getWidth() - + vScroller.getWidth() + 2)); + + vScroller.getWidth())); } }