Open
Description
Problem
UIs come often with more information or elements then fits on the screen. To solve this there are different solutions like, pagination, tab groups, etc.
While those are possible to implement, it would be a great improvement to provide a scrollable widget.
Details
- A scrollable widget should expose some variable to scroll in x and y axis.
- The size of the underlying canvas should be configureable (or not?)
- The boundaries (size) of visible area should be configureable
- child widget should not be able to escape the UIScrollArea
- Mouse interactions should be converted between window coordinates and UIScrollArea coordinates
Ideas
Reimplement Surface.limit
An option would be to implement a restriction, that child widgets are not able to "surface.limit()" the drawing area outside of the parent. With that it would be possible to "just" move the child widgets and only render them within the bounds of the UIScrollArea.
- This could be a general improvement to prevent any child from drawing outside of parents boundaries.
- Widgets like UIDropdown could be harder to implement
Use separate FBO
The UIScrollArea could enforce child rendering to a separate canvas (FBO/what ever) and only draw a subarea from that into the normal UI surface.
- Feels like a pretty strait implementation but still requires the UIScrollArea to reserve a canvas of the full size of the scroll area.