Skip to content

Commit 593cde5

Browse files
committed
Fix styling of recent JupyterWidget versions
1 parent be6137c commit 593cde5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pyqt_code_editor/components/jupyter_console.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ def __init__(self, kernel_name=None, parent=None):
9595
.out-prompt-number {{ color: red; }}
9696
'''
9797
self.jupyter_widget.setStyleSheet(stylesheet)
98+
# Recent versions of Jupyter require setting the stylesheet also on the
99+
# control and page control widget. But these may not exist in older
100+
# versions.
101+
if hasattr(self.jupyter_widget, '_control'):
102+
self.jupyter_widget._control.setStyleSheet(stylesheet)
103+
if hasattr(self.jupyter_widget, '_page_control'):
104+
self.jupyter_widget._page_control.setStyleSheet(stylesheet)
98105

99106
# Connect execution_complete to auto-update workspace
100107
self.execution_complete.connect(self._on_execution_complete)

0 commit comments

Comments
 (0)