8000 Add a `Slider::update_while_editing(bool)` API by mbernat · Pull Request #5978 · emilk/egui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a Slider::update_while_editing(bool) API #5978

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 1 commit into from
Apr 22, 2025

Conversation

mbernat
Copy link
Contributor
@mbernat mbernat commented Apr 11, 2025
Screen.Recording.2025-04-11.at.18.11.39.mov

@mbernat mbernat marked this pull request as ready for review April 11, 2025 16:45
Copy link

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

@lucasmerlin lucasmerlin added feature New feature or request egui labels Apr 15, 2025
Copy link
Collaborator
@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

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

Nice! It'd be cool if this would also make the slider only update the value once you let go though.

@mbernat
Copy link
Contributor Author
mbernat commented Apr 15, 2025

@lucasmerlin Thanks for the review! Do you have a suggestion for how the slider not updating should work? We would need a place to store the temporary value until you release the slider and I don't see a good place to put it. What would be an idiomatic way to do it? A hidden internal widget?

FWIW, DragValue::update_while_editing also affects only text edits, not dragging. It might be clearer to call the new API Slider::update_while_text_editing , though the naming inconsistency would be unfortunate.

8000

@lucasmerlin
Copy link
Collaborator

Ah right, that would add a lot of complexity. Don't worry about it, it was just wishful thinking haha.

@mbernat mbernat force-pushed the slider-update-while-editing branch from 268e134 to b46442b Compare April 16, 2025 13:55
@mbernat
Copy link
Contributor Author
mbernat commented Apr 16, 2025

@lucasmerlin I see, yeah, let's leave that for another day :)

I rebased on master to get the CI fixed. Is there anything else I should do once the CI passes?

@lucasmerlin
Copy link
Collaborator

No, I usually go over the approved PRs once per week with @emilk where we merge everything so he stays in the loop, so it might take a couple of days to get merged

@lucasmerlin lucasmerlin merged commit 009bfe5 into emilk:master Apr 22, 2025
25 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.

Slider widget: support not updating the value while editing the text input
2 participants
0