Skip to content
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

ScrollArea improvements for user configurability #5443

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MStarha
Copy link
Contributor

@MStarha MStarha commented Dec 6, 2024

The changes follow what is described in the issue with a couple changes:

  • Scroll bars are not hidden when dragging is disabled, for that ScrollArea::scroll_bar_visibility() has to be used, this is as not to limit the user configurability by imposing a specific function. The user might want to retain the scrollbars visibility to show the current position.
  • The input for mouse wheel scrolling is unchanged. When I inspected the code initially I made a mistake in recognizing the source of scrolling. Current implementation is in fact using InputState::smooth_scroll_delta and not PassState::scroll_delta, therefore it is possible to prevent scrolling by setting the InputState::smooth_scroll_delta to zero before painting the ScrollArea.

A simple demo is available at https://github.com/MStarha/egui_scroll_area_test

Copy link

github-actions bot commented Dec 6, 2024

Preview available at https://egui-pr-preview.github.io/pr/5443-scroll-area-adjustments
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScrollArea adjustments for better configuration/customization
1 participant