[vlc-commits] [Git][videolan/vlc][master] qt: use `QWheelEvent::DefaultDeltasPerStep` instead of hardcoded `120` in `FlickableScrollHandler`

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jan 18 09:53:46 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c978d50d by Fatih Uzunoglu at 2025-01-18T09:39:03+00:00
qt: use `QWheelEvent::DefaultDeltasPerStep` instead of hardcoded `120` in `FlickableScrollHandler`

- - - - -


1 changed file:

- modules/gui/qt/util/flickable_scroll_handler.cpp


Changes:

=====================================
modules/gui/qt/util/flickable_scroll_handler.cpp
=====================================
@@ -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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c978d50db67ad19d3739bc184d07ff1af47cd3c0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c978d50db67ad19d3739bc184d07ff1af47cd3c0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list