|
17 | 17 | import __main__ |
18 | 18 | import Qt as Qt_py |
19 | 19 | from Qt import QtCompat, QtCore, QtWidgets |
20 | | -from Qt.QtCore import QByteArray, QFileSystemWatcher, Qt, QTimer, Signal, Slot |
| 20 | +from Qt.QtCore import QByteArray, QFileSystemWatcher, QObject, Qt, QTimer, Signal, Slot |
21 | 21 | from Qt.QtGui import QCursor, QFont, QIcon, QKeySequence, QTextCursor |
22 | 22 | from Qt.QtWidgets import ( |
23 | 23 | QApplication, |
@@ -623,6 +623,7 @@ def change_to_workbox_version_text(self, versionType): |
623 | 623 |
|
624 | 624 | def openSetPreferredTextEditorDialog(self): |
625 | 625 | dlg = SetTextEditorPathDialog(parent=self) |
| 626 | + self.setDialogFont(dlg) |
626 | 627 | dlg.exec() |
627 | 628 |
|
628 | 629 | def focusToConsole(self): |
@@ -890,10 +891,17 @@ def setEditorChooserFontBasedOnConsole(self): |
890 | 891 | """Set the EditorChooser font to match console. This helps with legibility when |
891 | 892 | using EditorChooser. |
892 | 893 | """ |
893 | | - font = self.console().font() |
894 | | - for child in self.uiEditorChooserWGT.children(): |
895 | | - if hasattr(child, "font"): |
896 | | - child.setFont(font) |
| 894 | + self.setDialogFont(self.uiEditorChooserWGT) |
| 895 | + |
| 896 | + def setDialogFont(self, dialog): |
| 897 | + """Helper for when creating a dialog to have the font match the PrEditor font |
| 898 | +
|
| 899 | + Args: |
| 900 | + dialog (QDialog): The dialog for which to set the font |
| 901 | + """ |
| 902 | + for thing in dialog.findChildren(QObject): |
| 903 | + if hasattr(thing, "setFont"): |
| 904 | + thing.setFont(self.font()) |
897 | 905 |
|
898 | 906 | @classmethod |
899 | 907 | def _genPrefName(cls, baseName, index): |
|
0 commit comments