mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed back gesture responsiveness for swipe-to-reply on macOS.
This commit is contained in:
parent
e8dd2b9e7b
commit
dd100fb709
1 changed files with 6 additions and 2 deletions
|
@ -48,7 +48,8 @@ void SetupSwipeHandler(
|
||||||
update({
|
update({
|
||||||
.ratio = std::clamp(ratio, 0., 1.5),
|
.ratio = std::clamp(ratio, 0., 1.5),
|
||||||
.reachRatio = state->animationReach.value(0.),
|
.reachRatio = state->animationReach.value(0.),
|
||||||
.translation = int(base::SafeRound(-std::clamp(ratio, 0., 1.5) * threshold)),
|
.translation = int(
|
||||||
|
base::SafeRound(-std::clamp(ratio, 0., 1.5) * threshold)),
|
||||||
.msgBareId = state->finishByTopData.msgBareId,
|
.msgBareId = state->finishByTopData.msgBareId,
|
||||||
.cursorTop = state->cursorTop,
|
.cursorTop = state->cursorTop,
|
||||||
});
|
});
|
||||||
|
@ -171,7 +172,9 @@ void SetupSwipeHandler(
|
||||||
};
|
};
|
||||||
const auto cancel = released(0)
|
const auto cancel = released(0)
|
||||||
|| released(1)
|
|| released(1)
|
||||||
|| (touches.size() != (touchscreen ? 1 : 2))
|
|| (touchscreen
|
||||||
|
? (touches.size() != 1)
|
||||||
|
: (touches.size() <= 0 || touches.size() > 2))
|
||||||
|| (type == QEvent::TouchEnd)
|
|| (type == QEvent::TouchEnd)
|
||||||
|| (type == QEvent::TouchCancel);
|
|| (type == QEvent::TouchCancel);
|
||||||
if (cancel) {
|
if (cancel) {
|
||||||
|
@ -185,6 +188,7 @@ void SetupSwipeHandler(
|
||||||
.touch = true,
|
.touch = true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return base::EventFilterResult::Cancel;
|
||||||
} break;
|
} break;
|
||||||
case QEvent::Wheel: {
|
case QEvent::Wheel: {
|
||||||
const auto w = static_cast<QWheelEvent*>(e.get());
|
const auto w = static_cast<QWheelEvent*>(e.get());
|
||||||
|
|
Loading…
Add table
Reference in a new issue