Skip to content
This repository
Browse code

BUG: Scrolling pager in vsplit on Mac OSX tears.

On Mac OS X, scrolling the pager when it is split vertically causes the
help text to tear (i.e. the help text is unreadable).  This hack
attempts to make it a little better although the solution may not be
optimal at all.

Closes #1150, rebased to prevent recursive merge.
  • Loading branch information...
commit d0119c4d068f7d3642a7ccb2baeef977e227bd0c 1 parent 26662f4
Prabhu Ramachandran prabhuramachandran authored fperez committed

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. +10 0 IPython/frontend/qt/console/console_widget.py
10 IPython/frontend/qt/console/console_widget.py
@@ -364,6 +364,14 @@ def eventFilter(self, obj, event):
364 364 QtGui.qApp.sendEvent(obj, QtGui.QDragLeaveEvent())
365 365 return True
366 366
  367 + # Handle scrolling of the vsplit pager. This hack attempts to solve the
  368 + # problem of tearing of the pager window's help text on Mac OS X. This
  369 + # happens with PySide and PyQt. This fix isn't perfect but makes the
  370 + # pager more usable.
  371 + elif etype in [QtCore.QEvent.Wheel, QtCore.QEvent.NativeGesture] and \
  372 + obj == self._page_control:
  373 + self._page_control.repaint()
  374 + return True
367 375 return super(ConsoleWidget, self).eventFilter(obj, event)
368 376
369 377 #---------------------------------------------------------------------------
@@ -965,6 +973,8 @@ def _create_page_control(self):
965 973 elif self.kind == 'rich':
966 974 control = QtGui.QTextEdit()
967 975 control.installEventFilter(self)
  976 + viewport = control.viewport()
  977 + viewport.installEventFilter(self)
968 978 control.setReadOnly(True)
969 979 control.setUndoRedoEnabled(False)
970 980 control.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)

0 comments on commit d0119c4

Please sign in to comment.
Something went wrong with that request. Please try again.