20 from ..SubstyleDefinitionDialog import SubstyleDefinitionDialog |
20 from ..SubstyleDefinitionDialog import SubstyleDefinitionDialog |
21 |
21 |
22 from E5Gui import E5MessageBox, E5FileDialog |
22 from E5Gui import E5MessageBox, E5FileDialog |
23 |
23 |
24 import UI.PixmapCache |
24 import UI.PixmapCache |
25 |
|
26 try: |
|
27 MonospacedFontsOption = QFontDialog.FontDialogOption.MonospacedFonts |
|
28 except AttributeError: |
|
29 MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10) |
|
30 NoFontsOption = QFontDialog.FontDialogOptions(0) |
|
31 |
25 |
32 |
26 |
33 class EditorHighlightingStylesPage(ConfigurationPageBase, |
27 class EditorHighlightingStylesPage(ConfigurationPageBase, |
34 Ui_EditorHighlightingStylesPage): |
28 Ui_EditorHighlightingStylesPage): |
35 """ |
29 """ |
353 else: |
347 else: |
354 self.sampleText.setFont(font) |
348 self.sampleText.setFont(font) |
355 |
349 |
356 style, substyle = self.__currentStyles() |
350 style, substyle = self.__currentStyles() |
357 options = ( |
351 options = ( |
358 MonospacedFontsOption |
352 QFontDialog.FontDialogOption.MonospacedFonts |
359 if self.monospacedButton.isChecked() else |
353 if self.monospacedButton.isChecked() else |
360 NoFontsOption |
354 QFontDialog.FontDialogOption(0) |
361 ) |
355 ) |
362 font, ok = QFontDialog.getFont(self.lexer.font(style, substyle), self, |
356 font, ok = QFontDialog.getFont(self.lexer.font(style, substyle), self, |
363 "", options) |
357 "", options) |
364 if ok: |
358 if ok: |
365 setSampleFont(font, familyOnly, sizeOnly) |
359 setSampleFont(font, familyOnly, sizeOnly) |