diff options
author | 2021-07-22 21:28:21 +0700 | |
---|---|---|
committer | 2021-07-22 21:28:21 +0700 | |
commit | 46aab24d91eb083a2f030094e33f98ba8e0dad7f (patch) | |
tree | 15bfda19bd3b9b67f89245583fed13f2684d4144 /native | |
parent | 6069e90c9b1b44c405706e08b608ae39dae0b1f4 (diff) | |
download | iced-46aab24d91eb083a2f030094e33f98ba8e0dad7f.tar.gz iced-46aab24d91eb083a2f030094e33f98ba8e0dad7f.tar.bz2 iced-46aab24d91eb083a2f030094e33f98ba8e0dad7f.zip |
Enable scroll selection for `PickList` only when scroll is discrete
Diffstat (limited to '')
-rw-r--r-- | native/src/widget/pick_list.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/native/src/widget/pick_list.rs b/native/src/widget/pick_list.rs index 667c9f18..ddd0d0a2 100644 --- a/native/src/widget/pick_list.rs +++ b/native/src/widget/pick_list.rs @@ -247,15 +247,11 @@ where event_status } } - Event::Mouse(mouse::Event::WheelScrolled { delta }) - if layout.bounds().contains(cursor_position) - && !*self.is_open => + Event::Mouse(mouse::Event::WheelScrolled { + delta: mouse::ScrollDelta::Lines { y, .. }, + }) if layout.bounds().contains(cursor_position) + && !*self.is_open => { - let y = match delta { - mouse::ScrollDelta::Lines { y, .. } - | mouse::ScrollDelta::Pixels { y, .. } => y, - }; - fn find_next<'a, T: PartialEq>( selected: &'a T, mut options: impl Iterator<Item = &'a T>, |