Browse files

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...
1 parent 26662f4 commit d0119c4d068f7d3642a7ccb2baeef977e227bd0c @prabhuramachandran prabhuramachandran committed with fperez Dec 13, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 IPython/frontend/qt/console/console_widget.py
View
10 IPython/frontend/qt/console/console_widget.py
@@ -364,6 +364,14 @@ def eventFilter(self, obj, event):
QtGui.qApp.sendEvent(obj, QtGui.QDragLeaveEvent())
return True
+ # Handle scrolling of the vsplit pager. This hack attempts to solve the
+ # problem of tearing of the pager window's help text on Mac OS X. This
+ # happens with PySide and PyQt. This fix isn't perfect but makes the
+ # pager more usable.
+ elif etype in [QtCore.QEvent.Wheel, QtCore.QEvent.NativeGesture] and \
+ obj == self._page_control:
+ self._page_control.repaint()
+ return True
return super(ConsoleWidget, self).eventFilter(obj, event)
#---------------------------------------------------------------------------
@@ -965,6 +973,8 @@ def _create_page_control(self):
elif self.kind == 'rich':
control = QtGui.QTextEdit()
control.installEventFilter(self)
+ viewport = control.viewport()
+ viewport.installEventFilter(self)
control.setReadOnly(True)
control.setUndoRedoEnabled(False)
control.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)

0 comments on commit d0119c4

Please sign in to comment.