From 07ee204c9c95bf6c84a424b01d021887f9b6c715 Mon Sep 17 00:00:00 2001 From: Axel Gembe Date: Wed, 10 Aug 2022 16:18:32 +0200 Subject: [PATCH] Qt Console: Fix font reset when moving between screens When the console was moved between screen boundaries with different scaling settings, the font was reset. This is because QPlainTextEdit sets the documents default font back to its own font property when Qt has a font change event. This patch sets the font property of the editor instead of the document. this ports https://github.com/Electron-Cash/Electron-Cash/commit/60d63b3272ed80a207d0bc2c304f5faf3e8a4c50 related: https://github.com/Electron-Cash/Electron-Cash/issues/1314 --- electrum/gui/qt/console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/gui/qt/console.py b/electrum/gui/qt/console.py index 3ef064f02..5ae9fc586 100644 --- a/electrum/gui/qt/console.py +++ b/electrum/gui/qt/console.py @@ -58,7 +58,7 @@ class Console(QtWidgets.QPlainTextEdit): self.setGeometry(50, 75, 600, 400) self.setWordWrapMode(QtGui.QTextOption.WrapAnywhere) self.setUndoRedoEnabled(False) - self.document().setDefaultFont(QtGui.QFont(MONOSPACE_FONT, 10, QtGui.QFont.Normal)) + self.setFont(QtGui.QFont(MONOSPACE_FONT, 10, QtGui.QFont.Normal)) self.newPrompt("") # make sure there is always a prompt, even before first server.banner self.updateNamespace({'run':self.run_script})