Skip to content
Snippets Groups Projects
Commit c978d50d authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Steve Lhomme
Browse files

qt: use `QWheelEvent::DefaultDeltasPerStep` instead of hardcoded `120` in `FlickableScrollHandler`

parent be336c08
No related branches found
No related tags found
No related merge requests found
Pipeline #556482 passed with stage
in 14 minutes and 17 seconds
......@@ -101,14 +101,14 @@ bool FlickableScrollHandler::eventFilter(QObject *watched, QEvent *event)
using Type = decltype(ev)::Type;
if (!wheel->pixelDelta().isNull() && (wheel->pixelDelta().manhattanLength() % 120))
if (!wheel->pixelDelta().isNull() && (wheel->pixelDelta().manhattanLength() % QWheelEvent::DefaultDeltasPerStep))
{
ev.delta = wheel->pixelDelta();
ev.type = Type::Pixel;
}
else if (!m_handleOnlyPixelDelta && !wheel->angleDelta().isNull())
{
ev.delta = wheel->angleDelta() / 8 / 15;
ev.delta = wheel->angleDelta() / QWheelEvent::DefaultDeltasPerStep;
ev.type = Type::Degree;
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment