src/eric7/Preferences/ConfigurationPages/EditorStylesPage.py

Mon, 07 Nov 2022 17:19:58 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 07 Nov 2022 17:19:58 +0100
branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
permissions
-rw-r--r--

Corrected/acknowledged some bad import style and removed some obsolete code.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
8881
54e42bc2437a Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8854
diff changeset
3 # Copyright (c) 2006 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Editor Styles configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
10 from PyQt6.Qsci import QsciScintilla
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
11 from PyQt6.QtCore import pyqtSlot
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
12 from PyQt6.QtGui import QColor
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
13 from PyQt6.QtWidgets import QColorDialog, QFontDialog
9473
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
14
3f23dbf37dbe Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9413
diff changeset
15 from eric7 import Preferences
9482
a2bc06a54d9d Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9473
diff changeset
16 from eric7.QScintilla.QsciScintillaCompat import QsciScintillaCompat
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
18 from .ConfigurationPageBase import ConfigurationPageBase
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
19 from .Ui_EditorStylesPage import Ui_EditorStylesPage
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 942
diff changeset
21
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 class EditorStylesPage(ConfigurationPageBase, Ui_EditorStylesPage):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 Class implementing the Editor Styles configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
26
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8143
diff changeset
31 super().__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.setObjectName("EditorStylesPage")
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
34
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 self.foldStyles = [
8322
b422b4e77d19 Continued porting eric to PyQt6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8319
diff changeset
36 QsciScintilla.FoldStyle.PlainFoldStyle.value,
b422b4e77d19 Continued porting eric to PyQt6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8319
diff changeset
37 QsciScintilla.FoldStyle.CircledFoldStyle.value,
b422b4e77d19 Continued porting eric to PyQt6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8319
diff changeset
38 QsciScintilla.FoldStyle.BoxedFoldStyle.value,
b422b4e77d19 Continued porting eric to PyQt6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8319
diff changeset
39 QsciScintilla.FoldStyle.CircledTreeFoldStyle.value,
b422b4e77d19 Continued porting eric to PyQt6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8319
diff changeset
40 QsciScintilla.FoldStyle.BoxedTreeFoldStyle.value,
b422b4e77d19 Continued porting eric to PyQt6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8319
diff changeset
41 # the below ones are not (yet) defined in QsciScintilla
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 942
diff changeset
42 QsciScintillaCompat.ArrowFoldStyle,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 942
diff changeset
43 QsciScintillaCompat.ArrowTreeFoldStyle,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
45
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.edgeModes = [
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
47 QsciScintilla.EdgeMode.EdgeNone,
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
48 QsciScintilla.EdgeMode.EdgeLine,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
49 QsciScintilla.EdgeMode.EdgeBackground,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 ]
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
51
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
52 self.wrapModeComboBox.addItem(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
53 self.tr("Disabled"), QsciScintilla.WrapMode.WrapNone
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
54 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
55 self.wrapModeComboBox.addItem(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
56 self.tr("Word Boundary"), QsciScintilla.WrapMode.WrapWord
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
57 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
58 self.wrapModeComboBox.addItem(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
59 self.tr("Character Boundary"), QsciScintilla.WrapMode.WrapCharacter
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
60 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
61 self.wrapVisualComboBox.addItem(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
62 self.tr("No Indicator"), QsciScintilla.WrapVisualFlag.WrapFlagNone
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
63 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
64 self.wrapVisualComboBox.addItem(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
65 self.tr("Indicator by Text"), QsciScintilla.WrapVisualFlag.WrapFlagByText
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
66 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
67 self.wrapVisualComboBox.addItem(
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
68 self.tr("Indicator by Margin"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
69 QsciScintilla.WrapVisualFlag.WrapFlagByBorder,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
70 )
7202
d2f2a1fe0129 Modified sources to be in line with the minimum QScintilla requirement (v 2.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
71 self.wrapVisualComboBox.addItem(
d2f2a1fe0129 Modified sources to be in line with the minimum QScintilla requirement (v 2.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
72 self.tr("Indicator in Line Number Margin"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
73 QsciScintilla.WrapVisualFlag.WrapFlagInMargin,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
74 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75
6842
c83dcb7c6147 Editor, MiniEditor: added capability to configure the subline indentation for wrapped lines.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6648
diff changeset
76 self.wrapIndentComboBox.addItem(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
77 self.tr("Fixed"), QsciScintilla.WrapIndentMode.WrapIndentFixed
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
78 )
6842
c83dcb7c6147 Editor, MiniEditor: added capability to configure the subline indentation for wrapped lines.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6648
diff changeset
79 self.wrapIndentComboBox.addItem(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
80 self.tr("Aligned"), QsciScintilla.WrapIndentMode.WrapIndentSame
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
81 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
82 self.wrapIndentComboBox.addItem(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
83 self.tr("Aligned plus One"), QsciScintilla.WrapIndentMode.WrapIndentIndented
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
84 )
7202
d2f2a1fe0129 Modified sources to be in line with the minimum QScintilla requirement (v 2.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
85 self.wrapIndentComboBox.addItem(
d2f2a1fe0129 Modified sources to be in line with the minimum QScintilla requirement (v 2.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
86 self.tr("Aligned plus Two"),
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
87 QsciScintilla.WrapIndentMode.WrapIndentDeeplyIndented,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
88 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
89
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 # set initial values
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.foldingStyleComboBox.setCurrentIndex(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
93 self.foldStyles.index(Preferences.getEditor("FoldingStyle"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
94 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 except ValueError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.foldingStyleComboBox.setCurrentIndex(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.marginsFont = Preferences.getEditorOtherFonts("MarginsFont")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.marginsFontSample.setFont(self.marginsFont)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 self.defaultFont = Preferences.getEditorOtherFonts("DefaultFont")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 self.defaultFontSample.setFont(self.defaultFont)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.monospacedFont = Preferences.getEditorOtherFonts("MonospacedFont")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 self.monospacedFontSample.setFont(self.monospacedFont)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
103 self.monospacedCheckBox.setChecked(Preferences.getEditor("UseMonospacedFont"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
104 self.linenoCheckBox.setChecked(Preferences.getEditor("LinenoMargin"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
105 self.foldingCheckBox.setChecked(Preferences.getEditor("FoldingMargin"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
106
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 342
diff changeset
107 self.caretlineVisibleCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
108 Preferences.getEditor("CaretLineVisible")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
109 )
3067
8fd7ae10de2b Implemented support for the new QScintilla feature to always highlight the caret line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
110 self.caretlineAlwaysVisibleCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
111 Preferences.getEditor("CaretLineAlwaysVisible")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
112 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
113 self.caretWidthSpinBox.setValue(Preferences.getEditor("CaretWidth"))
6843
5e1afd1577b9 Editor: added these capabilities
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6842
diff changeset
114 self.caretlineFrameWidthSpinBox.setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
115 Preferences.getEditor("CaretLineFrameWidth")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
116 )
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 342
diff changeset
117 self.colourizeSelTextCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
118 Preferences.getEditor("ColourizeSelText")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
119 )
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 342
diff changeset
120 self.customSelColourCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
121 Preferences.getEditor("CustomSelectionColours")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
122 )
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 342
diff changeset
123 self.extentSelEolCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
124 Preferences.getEditor("ExtendSelectionToEol")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
125 )
5733
aed3e558407f Reintroduced the highlighting of current instruction line and the error line using colored background. It is configurable whether to use these backgrounds or the arrows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5706
diff changeset
126 self.debugMarkerBackgroundCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
127 Preferences.getEditor("LineMarkersBackground")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
128 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
129
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
130 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
131 "CaretForeground", self.caretForegroundButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
132 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
133 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
134 "CaretLineBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
135 self.caretlineBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
136 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
137 hasAlpha=True,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
138 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
139 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
140 "SelectionForeground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
141 self.selectionForegroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
142 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
143 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
144 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
145 "SelectionBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
146 self.selectionBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
147 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
148 hasAlpha=True,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
149 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
150 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
151 "CurrentMarker",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
152 self.currentLineMarkerButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
153 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
154 hasAlpha=True,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
155 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
156 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
157 "ErrorMarker",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
158 self.errorMarkerButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
159 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
160 hasAlpha=True,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
161 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
162 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
163 "MarginsForeground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
164 self.marginsForegroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
165 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
166 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
167 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
168 "MarginsBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
169 self.marginsBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
170 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
171 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
172 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
173 "FoldmarginBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
174 self.foldmarginBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
175 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
176 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
177 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
178 "FoldMarkersForeground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
179 self.foldmarkersForegroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
180 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
181 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
182 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
183 "FoldMarkersBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
184 self.foldmarkersBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
185 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
186 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
187
2230
2b1b9265156c Optimized the colour selection code of configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2164
diff changeset
188 self.editorColours = {}
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
189 self.editorColours["AnnotationsWarningForeground"] = QColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
190 Preferences.getEditorColour("AnnotationsWarningForeground")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
191 )
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
192 self.editorColours["AnnotationsWarningBackground"] = QColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
193 Preferences.getEditorColour("AnnotationsWarningBackground")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
194 )
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
195 self.editorColours["AnnotationsErrorForeground"] = QColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
196 Preferences.getEditorColour("AnnotationsErrorForeground")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
197 )
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
198 self.editorColours["AnnotationsErrorBackground"] = QColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
199 Preferences.getEditorColour("AnnotationsErrorBackground")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
200 )
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
201 self.editorColours["AnnotationsStyleForeground"] = QColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
202 Preferences.getEditorColour("AnnotationsStyleForeground")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
203 )
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
204 self.editorColours["AnnotationsStyleBackground"] = QColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
205 Preferences.getEditorColour("AnnotationsStyleBackground")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
206 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
207
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 self.eolCheckBox.setChecked(Preferences.getEditor("ShowEOL"))
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
209 self.wrapModeComboBox.setCurrentIndex(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
210 self.wrapModeComboBox.findData(Preferences.getEditor("WrapLongLinesMode"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
211 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
212 self.wrapVisualComboBox.setCurrentIndex(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
213 self.wrapVisualComboBox.findData(Preferences.getEditor("WrapVisualFlag"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
214 )
6842
c83dcb7c6147 Editor, MiniEditor: added capability to configure the subline indentation for wrapped lines.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6648
diff changeset
215 self.wrapIndentComboBox.setCurrentIndex(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
216 self.wrapIndentComboBox.findData(Preferences.getEditor("WrapIndentMode"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
217 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
218 self.wrapStartIndentSpinBox.setValue(Preferences.getEditor("WrapStartIndent"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
219
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 self.edgeModeCombo.setCurrentIndex(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
221 self.edgeModes.index(Preferences.getEditor("EdgeMode"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
222 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
223 self.edgeLineColumnSlider.setValue(Preferences.getEditor("EdgeColumn"))
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
224 self.initColour(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
225 "Edge", self.edgeBackgroundColorButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
226 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
227
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 342
diff changeset
228 self.bracehighlightingCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
229 Preferences.getEditor("BraceHighlighting")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
230 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
231 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
232 "MatchingBrace", self.matchingBracesButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
233 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
234 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
235 "MatchingBraceBack",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
236 self.matchingBracesBackButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
237 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
238 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
239 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
240 "NonmatchingBrace",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
241 self.nonmatchingBracesButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
242 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
243 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
244 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
245 "NonmatchingBraceBack",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
246 self.nonmatchingBracesBackButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
247 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
248 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
249
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
250 self.zoomfactorSlider.setValue(Preferences.getEditor("ZoomFactor"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
251
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
252 self.whitespaceCheckBox.setChecked(Preferences.getEditor("ShowWhitespace"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
253 self.whitespaceSizeSpinBox.setValue(Preferences.getEditor("WhitespaceSize"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
254 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
255 "WhitespaceForeground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
256 self.whitespaceForegroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
257 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
258 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
259 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
260 "WhitespaceBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
261 self.whitespaceBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
262 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
263 )
939
10d3a201cd27 Added configuration options for visible whitespace (as of QScintilla 2.5).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
264 if not hasattr(QsciScintilla, "setWhitespaceForegroundColor"):
10d3a201cd27 Added configuration options for visible whitespace (as of QScintilla 2.5).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
265 self.whitespaceSizeSpinBox.setEnabled(False)
10d3a201cd27 Added configuration options for visible whitespace (as of QScintilla 2.5).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
266 self.whitespaceForegroundButton.setEnabled(False)
10d3a201cd27 Added configuration options for visible whitespace (as of QScintilla 2.5).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
267 self.whitespaceBackgroundButton.setEnabled(False)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
268
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
269 self.miniMenuCheckBox.setChecked(Preferences.getEditor("MiniContextMenu"))
5416
16366120b523 Added an option to hide the format buttons bar, if formatting is not supported for the editor text type (only supported for HTML, Markdown and reStructured Text).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
270 self.hideFormatButtonsCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
271 Preferences.getEditor("HideFormatButtons")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
272 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
273
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
274 self.enableAnnotationsCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
275 Preferences.getEditor("AnnotationsEnabled")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
276 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
277
1566
0cb791cc631a Fixed the issue where a non matching background was shown in the editor for lines below the end of the text, if a lexer with a non-standard background was set.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
278 self.editAreaOverrideCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
279 Preferences.getEditor("OverrideEditAreaColours")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
280 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
281 self.initColour(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
282 "EditAreaForeground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
283 self.editAreaForegroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
284 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
285 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
286 self.initColour(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
287 "EditAreaBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
288 self.editAreaBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
289 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
290 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
291
2162
4627e6ea7b6b Added capability to mark changed lines and to navigate between them to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1566
diff changeset
292 self.enableChangeTraceCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
293 Preferences.getEditor("OnlineChangeTrace")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
294 )
2162
4627e6ea7b6b Added capability to mark changed lines and to navigate between them to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1566
diff changeset
295 self.changeTraceTimeoutSpinBox.setValue(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
296 Preferences.getEditor("OnlineChangeTraceInterval")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
297 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
298 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
299 "OnlineChangeTraceMarkerUnsaved",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
300 self.changeMarkerUnsavedColorButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
301 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
302 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
303 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
304 "OnlineChangeTraceMarkerSaved",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
305 self.changeMarkerSavedColorButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
306 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
307 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
308
6278
13fd8759f981 Editor, E5MapWidget: added a configuration option (Editor->Style page) to show the marker map on the left or right of the editor
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6111
diff changeset
309 self.markerMapRightCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
310 Preferences.getEditor("ShowMarkerMapOnRight")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
311 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
312 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
313 "BookmarksMap", self.bookmarksMapButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
314 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
315 self.initColour("ErrorsMap", self.errorsMapButton, Preferences.getEditorColour)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
316 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
317 "WarningsMap", self.warningsMapButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
318 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
319 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
320 "BreakpointsMap", self.breakpointsMapButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
321 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
322 self.initColour("TasksMap", self.tasksMapButton, Preferences.getEditorColour)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
323 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
324 "CoverageMap", self.coverageMapButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
325 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
326 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
327 "ChangesMap", self.changesMapButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
328 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
329 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
330 "CurrentMap", self.currentMapButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
331 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
332 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
333 "SearchMarkersMap", self.searchMarkerMapButton, Preferences.getEditorColour
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
334 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
335 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
336 "VcsConflictMarkersMap",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
337 self.conflictMarkerMapButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
338 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
339 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
340 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
341 "MarkerMapBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
342 self.markerMapBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
343 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
344 )
6648
c09e6c6006eb EditorMarkerMap: added cpability to suppress some markers in the marker map.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
345 self.changesMarkerCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
346 Preferences.getEditor("ShowMarkerChanges")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
347 )
6648
c09e6c6006eb EditorMarkerMap: added cpability to suppress some markers in the marker map.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
348 self.coverageMarkerCheckBox.setChecked(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
349 Preferences.getEditor("ShowMarkerCoverage")
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
350 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
351 self.searchMarkerCheckBox.setChecked(Preferences.getEditor("ShowMarkerSearch"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
352
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
353 self.indentguidesCheckBox.setChecked(Preferences.getEditor("IndentationGuides"))
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
354 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
355 "IndentationGuidesBackground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
356 self.indentationGuidesBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
357 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
358 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
359 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
360 "IndentationGuidesForeground",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
361 self.indentationGuidesForegroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
362 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
363 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
364
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
365 self.initColour(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
366 "HighlightMarker",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
367 self.highlightingBackgroundButton,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
368 Preferences.getEditorColour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
369 hasAlpha=True,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
370 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
371
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 def save(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 Public slot to save the Editor Styles configuration.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 """
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
376 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
377 "FoldingStyle", self.foldStyles[self.foldingStyleComboBox.currentIndex()]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
378 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
379 Preferences.setEditorOtherFonts("MarginsFont", self.marginsFont)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
380 Preferences.setEditorOtherFonts("DefaultFont", self.defaultFont)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
381 Preferences.setEditorOtherFonts("MonospacedFont", self.monospacedFont)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
382 Preferences.setEditor("UseMonospacedFont", self.monospacedCheckBox.isChecked())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
383
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
384 Preferences.setEditor("LinenoMargin", self.linenoCheckBox.isChecked())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
385 Preferences.setEditor("FoldingMargin", self.foldingCheckBox.isChecked())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
386
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
387 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
388 "CaretLineVisible", self.caretlineVisibleCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
389 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
390 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
391 "CaretLineAlwaysVisible", self.caretlineAlwaysVisibleCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
392 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
393 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
394 "ColourizeSelText", self.colourizeSelTextCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
395 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
396 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
397 "CustomSelectionColours", self.customSelColourCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
398 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
399 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
400 "ExtendSelectionToEol", self.extentSelEolCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
401 )
5733
aed3e558407f Reintroduced the highlighting of current instruction line and the error line using colored background. It is configurable whether to use these backgrounds or the arrows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5706
diff changeset
402 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
403 "LineMarkersBackground", self.debugMarkerBackgroundCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
404 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
405
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
406 Preferences.setEditor("CaretWidth", self.caretWidthSpinBox.value())
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
407 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
408 "CaretLineFrameWidth", self.caretlineFrameWidthSpinBox.value()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
409 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
410
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
411 Preferences.setEditor("ShowEOL", self.eolCheckBox.isChecked())
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
412 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
413 "WrapLongLinesMode",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
414 self.wrapModeComboBox.itemData(self.wrapModeComboBox.currentIndex()),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
415 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
416 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
417 "WrapVisualFlag",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
418 self.wrapVisualComboBox.itemData(self.wrapVisualComboBox.currentIndex()),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
419 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
420 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
421 "WrapIndentMode",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
422 self.wrapIndentComboBox.itemData(self.wrapIndentComboBox.currentIndex()),
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
423 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
424 Preferences.setEditor("WrapStartIndent", self.wrapStartIndentSpinBox.value())
6843
5e1afd1577b9 Editor: added these capabilities
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6842
diff changeset
425 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
426 "EdgeMode", self.edgeModes[self.edgeModeCombo.currentIndex()]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
427 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
428 Preferences.setEditor("EdgeColumn", self.edgeLineColumnSlider.value())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
429
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
430 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
431 "BraceHighlighting", self.bracehighlightingCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
432 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
433
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
434 Preferences.setEditor("ZoomFactor", self.zoomfactorSlider.value())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
435
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
436 Preferences.setEditor("ShowWhitespace", self.whitespaceCheckBox.isChecked())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
437 Preferences.setEditor("WhitespaceSize", self.whitespaceSizeSpinBox.value())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
438
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
439 Preferences.setEditor("MiniContextMenu", self.miniMenuCheckBox.isChecked())
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
440 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
441 "HideFormatButtons", self.hideFormatButtonsCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
442 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
443
5416
16366120b523 Added an option to hide the format buttons bar, if formatting is not supported for the editor text type (only supported for HTML, Markdown and reStructured Text).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
444 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
445 "AnnotationsEnabled", self.enableAnnotationsCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
446 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
447
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
448 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
449 "OverrideEditAreaColours", self.editAreaOverrideCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
450 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
451
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
452 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
453 "OnlineChangeTrace", self.enableChangeTraceCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
454 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
455 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
456 "OnlineChangeTraceInterval", self.changeTraceTimeoutSpinBox.value()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
457 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
458
4176
4c09d3d75768 Added capability to configure the indentation guides colors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4164
diff changeset
459 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
460 "IndentationGuides", self.indentguidesCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
461 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
462
6278
13fd8759f981 Editor, E5MapWidget: added a configuration option (Editor->Style page) to show the marker map on the left or right of the editor
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6111
diff changeset
463 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
464 "ShowMarkerMapOnRight", self.markerMapRightCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
465 )
6648
c09e6c6006eb EditorMarkerMap: added cpability to suppress some markers in the marker map.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
466 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
467 "ShowMarkerChanges", self.changesMarkerCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
468 )
6648
c09e6c6006eb EditorMarkerMap: added cpability to suppress some markers in the marker map.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
469 Preferences.setEditor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
470 "ShowMarkerCoverage", self.coverageMarkerCheckBox.isChecked()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
471 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
472 Preferences.setEditor("ShowMarkerSearch", self.searchMarkerCheckBox.isChecked())
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
473
2230
2b1b9265156c Optimized the colour selection code of configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2164
diff changeset
474 self.saveColours(Preferences.setEditorColour)
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
475 for key in list(self.editorColours.keys()):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 Preferences.setEditorColour(key, self.editorColours[key])
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
477
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 def on_linenumbersFontButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 Private method used to select the font for the editor margins.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 """
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
483 self.marginsFont = self.selectFont(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
484 self.marginsFontSample,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
485 self.marginsFont,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
486 options=QFontDialog.FontDialogOption.MonospacedFonts,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
487 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
488
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490 def on_defaultFontButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 Private method used to select the default font for the editor.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
494 self.defaultFont = self.selectFont(self.defaultFontSample, self.defaultFont)
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
495
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 def on_monospacedFontButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 """
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
499 Private method used to select the font to be used as the monospaced
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
500 font.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501 """
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
502 self.monospacedFont = self.selectFont(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
503 self.monospacedFontSample,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
504 self.monospacedFont,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
505 options=QFontDialog.FontDialogOption.MonospacedFonts,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
506 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
507
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
508 def __setSampleStyleSheet(self, sampleLineEdit, color, background):
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
509 """
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
510 Private method to colorize a sample with given foreground and
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
511 background colors.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
512
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
513 @param sampleLineEdit line edit element to be colorized
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
514 @type QLineEdit
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
515 @param color text color to be shown
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
516 @type QColor
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
517 @param background background color to be shown
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
518 @type QColor
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
519 """
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
520 sampleLineEdit.setStyleSheet(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
521 "QLineEdit {{ color: {0}; background-color: {1}; }}".format(
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
522 color.name(), background.name()
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
523 )
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
524 )
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
525
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
526 def polishPage(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
527 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
528 Public slot to perform some polishing actions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
529 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530 self.marginsFontSample.setFont(self.marginsFont)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 self.defaultFontSample.setFont(self.defaultFont)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 self.monospacedFontSample.setFont(self.monospacedFont)
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
533
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
534 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
535 self.annotationsWarningSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
536 self.editorColours["AnnotationsWarningForeground"],
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
537 self.editorColours["AnnotationsWarningBackground"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
538 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
539
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
540 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
541 self.annotationsErrorSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
542 self.editorColours["AnnotationsErrorForeground"],
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
543 self.editorColours["AnnotationsErrorBackground"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
544 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
545
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
546 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
547 self.annotationsStyleWarningSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
548 self.editorColours["AnnotationsStyleForeground"],
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
549 self.editorColours["AnnotationsStyleBackground"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
550 )
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
551
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
552 @pyqtSlot()
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
553 def on_annotationsWarningFgButton_clicked(self):
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
554 """
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
555 Private slot to set the foreground colour of the warning annotations.
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
556 """
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
557 colour = QColorDialog.getColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
558 self.editorColours["AnnotationsWarningForeground"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
559 )
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
560 if colour.isValid():
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
561 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
562 self.annotationsWarningSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
563 colour,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
564 self.editorColours["AnnotationsWarningBackground"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
565 )
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
566 self.editorColours["AnnotationsWarningForeground"] = colour
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
567
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
568 @pyqtSlot()
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
569 def on_annotationsWarningBgButton_clicked(self):
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
570 """
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
571 Private slot to set the background colour of the warning annotations.
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
572 """
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
573 colour = QColorDialog.getColor(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
574 self.editorColours["AnnotationsWarningBackground"]
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
575 )
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
576 if colour.isValid():
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
577 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
578 self.annotationsWarningSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
579 self.editorColours["AnnotationsWarningForeground"],
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
580 colour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
581 )
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
582 self.editorColours["AnnotationsWarningBackground"] = colour
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
583
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
584 @pyqtSlot()
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
585 def on_annotationsErrorFgButton_clicked(self):
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
586 """
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
587 Private slot to set the foreground colour of the error annotations.
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
588 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
589 colour = QColorDialog.getColor(self.editorColours["AnnotationsErrorForeground"])
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
590 if colour.isValid():
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
591 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
592 self.annotationsErrorSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
593 colour,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
594 self.editorColours["AnnotationsErrorBackground"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
595 )
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
596 self.editorColours["AnnotationsErrorForeground"] = colour
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
597
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
598 @pyqtSlot()
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
599 def on_annotationsErrorBgButton_clicked(self):
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
600 """
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
601 Private slot to set the background colour of the error annotations.
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
602 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
603 colour = QColorDialog.getColor(self.editorColours["AnnotationsErrorBackground"])
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
604 if colour.isValid():
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
605 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
606 self.annotationsErrorSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
607 self.editorColours["AnnotationsErrorForeground"],
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
608 colour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
609 )
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
610 self.editorColours["AnnotationsErrorBackground"] = colour
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
611
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
612 @pyqtSlot()
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
613 def on_annotationsStyleWarningFgButton_clicked(self):
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
614 """
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
615 Private slot to set the foreground colour of the style annotations.
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
616 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
617 colour = QColorDialog.getColor(self.editorColours["AnnotationsStyleForeground"])
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
618 if colour.isValid():
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
619 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
620 self.annotationsStyleWarningSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
621 colour,
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
622 self.editorColours["AnnotationsStyleBackground"],
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
623 )
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
624 self.editorColours["AnnotationsStyleForeground"] = colour
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
625
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
626 @pyqtSlot()
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
627 def on_annotationsStyleWarningBgButton_clicked(self):
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
628 """
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
629 Private slot to set the background colour of the style annotations.
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
630 """
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
631 colour = QColorDialog.getColor(self.editorColours["AnnotationsStyleBackground"])
2905
a1ae4b297bc0 Added capability to have different warning styles to the editor.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2640
diff changeset
632 if colour.isValid():
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
633 self.__setSampleStyleSheet(
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
634 self.annotationsStyleWarningSample,
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
635 self.editorColours["AnnotationsStyleForeground"],
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
636 colour,
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
637 )
8854
68c67538da4e Changed some more widgets to work with style sheets instead of manipulating the palette.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8322
diff changeset
638 self.editorColours["AnnotationsStyleBackground"] = colour
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
639
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 942
diff changeset
640
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641 def create(dlg):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
643 Module function to create the configuration page.
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
644
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
645 @param dlg reference to the configuration dialog
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2905
diff changeset
646 @return reference to the instantiated page (ConfigurationPageBase)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648 page = EditorStylesPage()
729
090203934c19 Finished implementing the annotations support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
649 return page

eric ide

mercurial