-
Notifications
You must be signed in to change notification settings - Fork 566
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
Make slider scrollable by mouse wheel #2104
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! We have a long-standing slider improvement PR that I'd like to get in first, though (#1979). Maybe this can be rebased on that afterwards? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Could you add your changes to the Changelog.
druid/src/widget/slider.rs
Outdated
let increment = if let Some(step) = self.step { | ||
step | ||
} else { | ||
0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases the difference between min and max is smaller than 0.1. This value should depend on min and max.
Ok, I merged #1979 so that isn't a blocker anymore. But you will need to rebase, because |
1029b29
to
0d715ed
Compare
Cool. Also planning to add mouse wheel support to the RangeSlider too then. |
Scrolling the 2022-01-10.20-29-18.mp4 |
self.mapping | ||
.calculate_value(me.pos, knob_size, ctx.size(), 0.0); | ||
|
||
if press_value - data.0 < data.1 - press_value { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to remember which knob was scrolled last
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the status here? @gordonshieh do you still want to move forward with this PR?
Please rebase on master
so that we can resolve the merge conflicts.
@@ -64,6 +64,7 @@ You can find its changes [documented below](#070---2021-01-01). | |||
- Scope: expose scoped state using state() and state_mut() ([#2082] by [@rjwittams] | |||
- Tabs: allow getting and setting the tab index of a Tabs widget ([#2082] by [@rjwittams] | |||
- `RangeSlider` and `Annotated` ([#1979] by [@xarvic]) | |||
- `Slider` widget now scrollable by mouse wheel ([#2104] by [@gordonshieh]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the links aren't automatically generated. Please manually define both [#2104]
and [@gordonshieh]
at the bottom of the file.
When hovered over a slider, and a user scrolls with their mouse wheel, the slider will move