-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement/fix/complete implementation of scrollbars #554
Conversation
44ced54
to
cc5cfe4
Compare
bd764ca
to
a601251
Compare
* Implement TrackClickBehaviors correctly * Fix macOS scrollbar styling * Provide ScrollableContainers for a simple, turn-key scrollbar API * Make expanded scrollbar not hide while the mouse moves over the scrollable composable * Fix the expanding behaviour and animation on macOS * Fix the visibility logic on macOS * Resolve a number of inconsistencies with Swing implementations * Simplify and consolidate internal implementation * Separate tabStrip scrollbar styling
* Fix thumb colour fade in AlwaysVisible mode * Move sample border to Outside so it doesn't overlap the scrollbar
* Rework layout/draw logic to finally align with Swing, in dark mode too * Switch to custom drawing for the thumb for more control
* Cleanup code * Update API definitions
* Make bridge compile * Fix styling in bridge * Update bridge samples * Fix TextArea scrollbars
* Fix bug in ScrollableContainer * Improve ReleasesSampleCompose
* Rewrite MacScrollbarHelper to avoid native crashes
* Add decorationModifier to TextArea API (useful e.g., for padding when there are scrollbars) * Fix ScrollableContainerImpl layout logic and bugs * Fix one HorizontallyScrollableContainer using vScroll by mistake * Use HorizontallyScrollableContainer in Markdown block renderer * Update standalone sample Markdown with new APIs
* Add mouse move linger behaviour to all ScrollableContainers * Add horizontal scrolling example to standalone sample * Fix ScrollableContainerImpl layout bug with WhenScrolling
* Remove debug bg from Scrollbars sample * Fix thumb appearing/disappearing animation * Fix colour animations * Keep AlwaysVisible thumb "hovered" while dragging * Fix styling in the bridge
* Fix InputField ignoring provided scrollbar style * Remove useless KDocs from TextArea/TextField * Clean up code * Mark non-state-based TextArea/TextField as scheduled for removal
* Fix native crash when TextField/TextArea don't have a fixed width * Redo the entire BTF2-based InputField implementation, better * Expose all the new parameters that BTF2-based InputField has to the users of TextField and TextArea * Fix TextArea decoration and scrollbars
* Fix scrollbars on Windows and Linux * Fix TextArea end padding to account for scrollbar
7c708d5
to
31d1b98
Compare
* Clean up code * Add scrollbar to undecorated TextAreas
@hamen @devkanro I am sorry this ended up being huge, I had to rewrite ~95% of everything scrollbars as the previous implementation was simply not working well, and/or not flexible enough. Once this is merged we can ship 0.23.0, finally! PS: there are some minor inconsistencies with Swing tracked in the linked issues in the description — they're all P2/P3 for what I am concerned, though. |
No worries. We will take care of it on Monday 🙏🏻 |
This PR overhauls how scrollbars are implemented, fixing all known issues and implementing the features that were forgotten/missing.
AlwaysVisible
, where the scrollbars are always visible and have always the same thickness. This is the most similar to Win/Linux behavior on macOS but doesn't 100% match it.WhenScrolling
, scrollbars are only visible while scrollingNextPage
, clicking moves the viewport by a whole page, but not moreJumpToSpot
, moves the viewport to the point that was clicked (may be more than a page)WhenScrolling
+JumpToPoint
, Win/Linux:AlwaysVisible
+JumpToPoint
)ScrollbarHelper
to react to macOS system prefs changes, like Swing does. On Win/Linux it's always using the defaults, like in standalone.ScrollableContainer
API makes it all super easy for you, and handles overlaying or not the scroll bars over the scrollable content, like Swing doesscrollbarContentSafePadding
function provides an optional padding to apply to scrollable content important parts to avoid them being overlapped byWhenScrolling
scrollbars.TODO
ScrollableContainer
variants