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

Add custom mouse precision property for SliderBar #6376

Closed
wants to merge 2 commits into from

Conversation

OliBomby
Copy link
Contributor

RFC. In UI i thought it would be be nice to have a slider bar with text input field with higher precision, so you can quickly change a integer value with the sliderbar but use the text field if you need more precision. Example video below using a Slider from WPF.
In osu! framework this behaviour is not possible because the text input and slider bar have to share a Bindable and that bindable determines the precision of the slider bar and text input. This PR fixes this by adding a custom precision to the slider bar.

Mapping_Tools_gOeUE8Q1yx.mp4

@bdach
Copy link
Collaborator

bdach commented Sep 18, 2024

In osu! framework this behaviour is not possible because the text input and slider bar have to share a Bindable and that bindable determines the precision of the slider bar and text input

It's not immediately clear to me why this is an issue exactly? You steer mouse step by changing precision of the bindable. If you don't want the coupling, you can have a loose-coupled setup wherein the slider bindable is not bound to the other bindable but you set up bidirectional or one-directional value change callbacks to propagate the value.

I'm personally going to require a more convincing rationale to try this because the OP is not doing it for me. In particular, consider this: what happens if you set a Step that the underlying bindable cannot support? Something like 0.05 step and 0.1 precision. I imagine things will begin to break down at that point.

@OliBomby
Copy link
Contributor Author

If you don't want the coupling, you can have a loose-coupled setup wherein the slider bindable is not bound to the other bindable but you set up bidirectional or one-directional value change callbacks to propagate the value.

That setup is actually not as bad as I initially thought. After implementing it the callback loop you create is not hard to fix.

@OliBomby OliBomby closed this Sep 18, 2024
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.

2 participants