Skip to content

Commit

Permalink
IPython console: Make print dialog follow the app style
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Nov 10, 2023
1 parent 03113a0 commit 559d859
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spyder/plugins/ipythonconsole/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from qtconsole.svg import save_svg, svg_to_clipboard
from qtpy.QtCore import Signal, Slot
from qtpy.QtGui import QColor, QKeySequence
from qtpy.QtPrintSupport import QPrintDialog, QPrinter
from qtpy.QtWebEngineWidgets import WEBENGINE
from qtpy.QtWidgets import (
QApplication, QHBoxLayout, QLabel, QMessageBox, QVBoxLayout, QWidget)
Expand Down Expand Up @@ -52,6 +53,7 @@
from spyder.widgets.browser import FrameWebView
from spyder.widgets.findreplace import FindReplace
from spyder.widgets.tabs import Tabs
from spyder.widgets.printer import SpyderPrinter


# Logging
Expand Down Expand Up @@ -1865,7 +1867,12 @@ def _current_client_export(self):
def _current_client_print(self):
client = self.get_current_client()
if client:
client.shellwidget.print_()
# This makes the print dialog have the same style as the rest of
# the app.
printer = SpyderPrinter(mode=QPrinter.HighResolution)
if(QPrintDialog(printer, self).exec_() != QPrintDialog.Accepted):
return
client.shellwidget._control.print_(printer)

def _current_client_clear_line(self):
client = self.get_current_client()
Expand Down

0 comments on commit 559d859

Please sign in to comment.