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

Allow changing shape of slider handle #3429

Merged
merged 7 commits into from
Nov 21, 2023

Conversation

YgorSouza
Copy link
Contributor

@YgorSouza YgorSouza commented Oct 2, 2023

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.

Looks good, but adding the settings to every WidgetVisuals seems overkill - I think the belongs in Visuals instead

crates/egui/src/widgets/slider.rs Outdated Show resolved Hide resolved
crates/egui/src/widgets/slider.rs Outdated Show resolved Hide resolved
@YgorSouza
Copy link
Contributor Author

Looks good, but adding the settings to every WidgetVisuals seems overkill - I think the belongs in Visuals instead

I thought about that, but I figured maybe someone could want to change the aspect ratio or shape when the slider is hovered or clicked, as an alternative to the expansion setting, and that would be very hard to do without the setting on WidgetVisuals. On the other hand, it does mean that everyone who doesn't want that is going to have to change this setting 3 times instead of 1, so maybe it's not such a great tradeoff. I'll change it.

Make it follow the same logic as the trailing_fill. So now it also has
an override method on the slider, and an example in the demo.
@emilk emilk added the egui label Nov 16, 2023
@emilk emilk changed the title Add rectangular handle for slider Allow changing handle shape of a slider Nov 16, 2023
crates/egui/src/style.rs Outdated Show resolved Hide resolved
crates/egui/src/widgets/slider.rs Show resolved Hide resolved
crates/egui_demo_lib/src/demo/sliders.rs Outdated Show resolved Hide resolved
@emilk emilk merged commit 49eecc4 into emilk:master Nov 21, 2023
19 checks passed
@emilk emilk changed the title Allow changing handle shape of a slider Allow changing shae of slider handle Nov 23, 2023
@emilk emilk changed the title Allow changing shae of slider handle Allow changing shape of slider handle Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change slider indicator to a rounded rect
2 participants