Skip to content

Commit

Permalink
Add mouse wheel scroll to search box
Browse files Browse the repository at this point in the history
  • Loading branch information
1n5pire committed Nov 17, 2021
1 parent 2803431 commit f56f03d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions planit/ui/widgets/vertically_scrollable_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def __init__(self, master, **kwargs):
self._container_id = self.canvas.create_window(0, 0, window=self.container, anchor=tk.NW)
self.container.bind("<Configure>", lambda event: self._update_scrollregion())
self.canvas.bind("<Configure>", self._on_container_resize)
self.canvas.bind_all("<MouseWheel>", self._on_mouse_wheel_scroll)

def _on_mouse_wheel_scroll(self, event):
self.canvas.yview_scroll(int(-1 * (event.delta / 120)), "units")

def _update_scrollregion(self):
self.canvas.config(scrollregion=self.canvas.bbox(tk.ALL))
Expand Down

0 comments on commit f56f03d

Please sign in to comment.