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

Slider: Add step parameter #1225

Merged
merged 9 commits into from Feb 13, 2022
Merged

Slider: Add step parameter #1225

merged 9 commits into from Feb 13, 2022

Conversation

Gordon01
Copy link
Contributor

@Gordon01 Gordon01 commented Feb 7, 2022

PR adds step_by() method to egui::Slider.
It allows adjusting the value of the slider with discrete steps, which is useful when we want to control something like the number of bits in a buffer and similar.

The demo app is updated: added one more slider, which controls the step value of another.

@Gordon01 Gordon01 changed the title Add step parameter to egui::Slider Slider: Add step parameter Feb 7, 2022
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.

Good addition, buts needs some polish!

egui_demo_lib/src/apps/demo/widget_gallery.rs Outdated Show resolved Hide resolved
egui/src/widgets/slider.rs Outdated Show resolved Hide resolved
egui/src/widgets/slider.rs Outdated Show resolved Hide resolved
egui/src/widgets/slider.rs Outdated Show resolved Hide resolved
egui/src/widgets/slider.rs Outdated Show resolved Hide resolved
@emilk
Copy link
Owner

emilk commented Feb 9, 2022

Needs cargo fmt.

@emilk emilk merged commit 62504ff into emilk:master Feb 13, 2022
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.

None yet

2 participants