|  | 
| 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, | 
| @@ -618,6 +618,7 @@ def change_to_workbox_version_text(self, versionType): | 
| 618 | 618 | 
 | 
| 619 | 619 |     def openSetPreferredTextEditorDialog(self): | 
| 620 | 620 |         dlg = SetTextEditorPathDialog(parent=self) | 
|  | 621 | +        self.setDialogFont(dlg) | 
| 621 | 622 |         dlg.exec() | 
| 622 | 623 | 
 | 
| 623 | 624 |     def focusToConsole(self): | 
| @@ -879,10 +880,17 @@ def setEditorChooserFontBasedOnConsole(self): | 
| 879 | 880 |         """Set the EditorChooser font to match console. This helps with legibility when | 
| 880 | 881 |         using EditorChooser. | 
| 881 | 882 |         """ | 
| 882 |  | -        font = self.console().font() | 
| 883 |  | -        for child in self.uiEditorChooserWGT.children(): | 
| 884 |  | -            if hasattr(child, "font"): | 
| 885 |  | -                child.setFont(font) | 
|  | 883 | +        self.setDialogFont(self.uiEditorChooserWGT) | 
|  | 884 | + | 
|  | 885 | +    def setDialogFont(self, dialog): | 
|  | 886 | +        """Helper for when creating a dialog to have the font match the PrEditor font | 
|  | 887 | +
 | 
|  | 888 | +        Args: | 
|  | 889 | +            dialog (QDialog):  The dialog for which to set the font | 
|  | 890 | +        """ | 
|  | 891 | +        for thing in dialog.findChildren(QObject): | 
|  | 892 | +            if hasattr(thing, "setFont"): | 
|  | 893 | +                thing.setFont(self.font()) | 
| 886 | 894 | 
 | 
| 887 | 895 |     @classmethod | 
| 888 | 896 |     def _genPrefName(cls, baseName, index): | 
|  | 
0 commit comments