Skip to content

Commit

Permalink
Improve wheel scrolling in LibraryPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
s-simoncelli committed Feb 17, 2024
1 parent 6d88951 commit 1927ad0
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions pywr_editor/toolbar/node_library/schematic_items_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1927ad0

Please sign in to comment.