mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Improved mouse wheel handling in vertical drum picker without animation.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user