summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-29 19:45:18 +0100
committerhut <hut@lavabit.com>2009-12-29 19:45:18 +0100
commitb4cb1f7d98ad6a98207c630ac2ee20b753621cd3 (patch)
treeadb1aa83e7411fcaa5d86e889a5a43863f417131 /ranger
parentacde88ad401904abab55bfc259cb74c6d5e661a6 (diff)
downloadranger-b4cb1f7d98ad6a98207c630ac2ee20b753621cd3.tar.gz
fixed mouse events in pager
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/ui.py9
-rw-r--r--ranger/gui/widgets/filelistcontainer.py9
-rw-r--r--ranger/gui/widgets/pager.py8
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]
18 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331