mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improved mouse wheel handling in vertical drum picker without animation.
This commit is contained in:
parent
d14e32f63e
commit
5ee7cb4dbf
1 changed files with 6 additions and 2 deletions
|
@ -12,8 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
||||||
PickerAnimation::PickerAnimation() {
|
PickerAnimation::PickerAnimation() = default;
|
||||||
}
|
|
||||||
|
|
||||||
void PickerAnimation::jumpToOffset(int offset) {
|
void PickerAnimation::jumpToOffset(int offset) {
|
||||||
_result.from = _result.current;
|
_result.from = _result.current;
|
||||||
|
@ -95,8 +94,13 @@ VerticalDrumPicker::VerticalDrumPicker(
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
_animation.updates(
|
_animation.updates(
|
||||||
|
) | rpl::distinct_until_changed(
|
||||||
) | rpl::start_with_next([=](PickerAnimation::Shift shift) {
|
) | rpl::start_with_next([=](PickerAnimation::Shift shift) {
|
||||||
increaseShift(shift);
|
increaseShift(shift);
|
||||||
|
if (anim::Disabled()) {
|
||||||
|
animationDataFromIndex();
|
||||||
|
_animation.jumpToOffset(0);
|
||||||
|
}
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue