diff options
author | hut <hut@lavabit.com> | 2009-12-29 19:45:18 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-12-29 19:45:18 +0100 |
commit | b4cb1f7d98ad6a98207c630ac2ee20b753621cd3 (patch) | |
tree | adb1aa83e7411fcaa5d86e889a5a43863f417131 /ranger | |
parent | acde88ad401904abab55bfc259cb74c6d5e661a6 (diff) | |
download | ranger-b4cb1f7d98ad6a98207c630ac2ee20b753621cd3.tar.gz |
fixed mouse events in pager
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/ui.py | 9 | ||||
-rw-r--r-- | ranger/gui/widgets/filelistcontainer.py | 9 | ||||
-rw-r--r-- | ranger/gui/widgets/pager.py | 8 |
3 files changed, 18 insertions, 8 deletions
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 91964eb1..254b7eab 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -95,14 +95,7 @@ class UI(DisplayableContainer): # log('{0:0>28b} ({0})'.format(event.bstate)) # log('y: {0} x: {1}'.format(event.y, event.x)) - if DisplayableContainer.click(self, event): - return - - n = event.ctrl() and 1 or 3 - if event.pressed(4): - self.fm.scroll(relative = -n) - elif event.pressed(2) or event.key_invalid(): - self.fm.scroll(relative = n) + DisplayableContainer.click(self, event) def handle_key(self, key): """Handles key input""" diff --git a/ranger/gui/widgets/filelistcontainer.py b/ranger/gui/widgets/filelistcontainer.py index 7b52a641..b5ef4190 100644 --- a/ranger/gui/widgets/filelistcontainer.py +++ b/ranger/gui/widgets/filelistcontainer.py @@ -74,6 +74,15 @@ class FileListContainer(Widget, DisplayableContainer): left += wid + def click(self, event): + n = event.ctrl() and 1 or 3 + if event.pressed(4): + self.fm.scroll(relative = -n) + elif event.pressed(2) or event.key_invalid(): + self.fm.scroll(relative = n) + else: + DisplayableContainer.click(self, event) + def open_pager(self): self.pager.activate(True) self.pager.open() diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index 7b55027c..c149f89a 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -101,6 +101,14 @@ class Pager(Widget): self.source = source return True + def click(self, event): + n = event.ctrl() and 1 or 3 + if event.pressed(4): + self.move(relative = -n) + elif event.pressed(2) or event.key_invalid(): + self.move(relative = n) + return True + def _get_line(self, n, attempt_to_read=True): try: return self.lines[n] |