JDK-8199934: ScrollPaneSkin incorrectly lays out its scrollbars
Nir Lisker
nlisker at gmail.com
Sun Apr 30 17:04:15 UTC 2023
Hi,
I took a quick jab at this issue [1]. Using the reproducer in the ticket,
launch and resize the stage vertically so that the buttons at the bottom
are only partially visible.
The current behavior is as follows:
When the scrollbar is not needed, toggling to the AS_NEEDED policy
reallocates the scrollbar space for the buttons (they move up).
When the scrollbar is needed, toggling to the AS_NEEDED policy still
reallocates space, and the scrollbar takes away space from the content
node. This is wrong.
I modified the method 'computeHsbSizeHint' to
private double computeHsbSizeHint(ScrollPane sp) {
return determineHorizontalSBVisible() ?
hsb.prefHeight(ScrollBar.USE_COMPUTED_SIZE) : 0;
}
Now the policy toggling behavior is correct both when the scrollbar is
needed and when it's not - the space is reallocated not at the expense of
the content. However, enlarging the stage horizontally while AS_NEEDED is
selected does not reallocate the space (you need to toggle the policies).
I'm guessing there's a missing call to layoutChildren during this resizing.
Does anyone have any input here?
Thanks,
Nir
[1] https://bugs.openjdk.org/browse/JDK-8199934
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20230430/d80f4f16/attachment-0001.htm>
More information about the openjfx-dev
mailing list