mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't jump by scroll events in stories viewer.
This commit is contained in:
parent
3654c197a9
commit
ce39431beb
1 changed files with 3 additions and 2 deletions
|
@ -5065,8 +5065,9 @@ void OverlayWidget::handleKeyPress(not_null<QKeyEvent*> e) {
|
||||||
void OverlayWidget::handleWheelEvent(not_null<QWheelEvent*> e) {
|
void OverlayWidget::handleWheelEvent(not_null<QWheelEvent*> e) {
|
||||||
constexpr auto step = int(QWheelEvent::DefaultDeltasPerStep);
|
constexpr auto step = int(QWheelEvent::DefaultDeltasPerStep);
|
||||||
|
|
||||||
const auto acceptForJump = (e->source() == Qt::MouseEventNotSynthesized)
|
const auto acceptForJump = !_stories
|
||||||
|| (e->source() == Qt::MouseEventSynthesizedBySystem);
|
&& ((e->source() == Qt::MouseEventNotSynthesized)
|
||||||
|
|| (e->source() == Qt::MouseEventSynthesizedBySystem));
|
||||||
_verticalWheelDelta += e->angleDelta().y();
|
_verticalWheelDelta += e->angleDelta().y();
|
||||||
while (qAbs(_verticalWheelDelta) >= step) {
|
while (qAbs(_verticalWheelDelta) >= step) {
|
||||||
if (_verticalWheelDelta < 0) {
|
if (_verticalWheelDelta < 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue