Make slider scrollable by mouse wheel#2104
Make slider scrollable by mouse wheel#2104gordonshieh wants to merge 9 commits intolinebender:masterfrom
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? |
xarvic
left a comment
There was a problem hiding this comment.
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.
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.
We need to remember which knob was scrolled last
xStrom
left a comment
There was a problem hiding this comment.
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.
| - 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.
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