From 57263f17f16cf5fc03d6ee0fa83a3061ab3d47a3 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sat, 17 Feb 2024 09:01:05 +0000 Subject: [PATCH] Improve wheel scrolling in LibraryPanel --- .../toolbar/node_library/schematic_items_library.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pywr_editor/toolbar/node_library/schematic_items_library.py b/pywr_editor/toolbar/node_library/schematic_items_library.py index 6b50efb..e15eed2 100644 --- a/pywr_editor/toolbar/node_library/schematic_items_library.py +++ b/pywr_editor/toolbar/node_library/schematic_items_library.py @@ -268,20 +268,11 @@ def reload(self) -> None: def wheelEvent(self, event: PySide6.QtGui.QWheelEvent) -> None: """ - Handles zoom using the mouse wheel. + Toggle the scroll buttons. :param event: The event being triggered. :return: None """ - # make scroll smoother - delta = 4 - if event.angleDelta().y() > 0: - scroll_delta = -delta - else: - scroll_delta = delta - self.verticalScrollBar().setValue( - self.verticalScrollBar().value() + scroll_delta - ) - # toggle scroll buttons + super().wheelEvent(event) self.parent().toggle_scroll_buttons() def mousePressEvent(self, event: PySide6.QtGui.QMouseEvent) -> None: