Skip to content

ScrollArea improvements for user configurability #5443

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

Merged
merged 8 commits into from
Apr 25, 2025

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.

@MStarha
Copy link
Contributor Author

MStarha commented Mar 14, 2025

Hey @emilk, sorry to bother you, but how can I fix this PR so that it can be merged?

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this one! Looks great, but needs to merge in latest master

@MStarha
Copy link
Contributor Author

MStarha commented Apr 22, 2025

Shall I rebase to latest master, or is there anything else needed?

@emilk
Copy link
Owner

emilk commented Apr 22, 2025

No, just rebase or merge in latest master

@MStarha MStarha force-pushed the scroll-area-adjustments branch from 188bc8c to afce459 Compare April 22, 2025 19:05
@MStarha
Copy link
Contributor Author

MStarha commented Apr 22, 2025

I rebased the branch and checked that the demo app still works the same. So is it ready to merge?

@emilk
Copy link
Owner

emilk commented Apr 24, 2025

So is it ready to merge?

There is a bunch of CI failures

@MStarha
Copy link
Contributor Author

MStarha commented Apr 24, 2025

I fixed the warnings that I could see in the CI, but now there is a conflict which I do not seem to have the right to resolve.

@MStarha
Copy link
Contributor Author

MStarha commented Apr 24, 2025

I seem to have resolved the conflict though I do not understand how I did it (I see the merge of master, but I do not know why it was necessary).

@emilk emilk added feature New feature or request egui labels Apr 25, 2025
@emilk emilk merged commit f2ce642 into emilk:master Apr 25, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScrollArea adjustments for better configuration/customization
2 participants