Improved mouse wheel handling in vertical drum picker without animation.
This commit is contained in:
parent
d14e32f63e
commit
5ee7cb4dbf
|
@ -12,8 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
namespace Ui {
|
||||
|
||||
PickerAnimation::PickerAnimation() {
|
||||
}
|
||||
PickerAnimation::PickerAnimation() = default;
|
||||
|
||||
void PickerAnimation::jumpToOffset(int offset) {
|
||||
_result.from = _result.current;
|
||||
|
@ -95,8 +94,13 @@ VerticalDrumPicker::VerticalDrumPicker(
|
|||
}, lifetime());
|
||||
|
||||
_animation.updates(
|
||||
) | rpl::distinct_until_changed(
|
||||
) | rpl::start_with_next([=](PickerAnimation::Shift shift) {
|
||||
increaseShift(shift);
|
||||
if (anim::Disabled()) {
|
||||
animationDataFromIndex();
|
||||
_animation.jumpToOffset(0);
|
||||
}
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue