Add ScrollView to Pixely.Ui with wheel routing and overlay scrollbars - #513
Merged
Merged
Conversation
stanoddly
force-pushed
the
worktree-ui-scroll-view-proposal
branch
from
September 15, 2026 04:11
25946c0 to
81f2896
Compare
…utorial after rebase
|
📦 Development package |
|
✅ Development package validation passed on all platforms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ScrollView, a container that shows a window onto children larger than itself, scrolled by the mouse wheel, by its bars and from code. The design was reviewed by codex before implementation.ScrollViewis aColumnthat clips, with the children slid byScrollOffset: itsLayoutis the ordinary one and may be replaced, so a horizontal strip is a scroll view with a horizontal stack andScrollAxes.Horizontal.Axes(measure property) says which axes scroll; on those the children are measured without a bound, soGrowandPercentdegrade there as documented andGrowon the cross axis fills a definite width as in a columnScrollOffsetis an arrange property, clamped into[0, MaxScrollOffset]at the next build, soint.MaxValuemeans the end once laid out;ScrollBymoves within the last build's range synchronously and reports whether it movedScrollBarsAuto/Hidden/Visible, never on an axis that does not scroll; a track press pages by one viewport; thumb dragging is left for a later move notificationScrollAppearanceonUiStyle.Scroll:Thumbper state, optionalTrack,Thickness,MinimumThumbLengthWheel input:
IScrollTarget.OnScroll(position, delta)returns theScrollAxesit took; refusing means an outward delta at an end or an unsupported axis, and taking includes banking a touchpad fraction too small to move a pixelUiInputSystemsubscribes to the wheel andUiRoot.PointerScrolledroutes it: the topmost element of either kind under the pointer, then up through its ancestors, each taking the axes it can use, so a dialog over a list does not scroll it, a wheel over a button inside a list does, and a horizontal strip inside a vertical list splits a mixed delta between the two; consumed only when something took some of itHitKindper entry, so a scroll-only element stays transparent to the pointerElementchanges:ResolveContentConstraintsvirtual, called once per measure, is whatILayoutHostresolves every child's sizing against; the default commits what was offeredAttachAdornment,Adornments): owned elements outsideChildren, painted and hit-collected after them, never laid out, invalidated with the subtree; the bars use it, soChildren.Clear()cannot reach themAlso
docs/ui.md(Scrolling section, wheel and style notes), thePixely.Tutorials.UiScrollViewtutorial, and 45 tests acrossScrollViewTests,ScrollRoutingTestsandUiInputSystemTests. The tutorial was verified headless with screenshots: wheel over the list, paging by a track press, hover following the wheel, a click on a button scrolled into view.