eric6/Preferences/ConfigurationPages/EditorStylesPage.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
diff -r 27f636beebad -r 2c730d5fd177 eric6/Preferences/ConfigurationPages/EditorStylesPage.py
--- a/eric6/Preferences/ConfigurationPages/EditorStylesPage.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/EditorStylesPage.py	Tue Mar 02 17:17:09 2021 +0100
@@ -18,7 +18,7 @@
 import Preferences
 
 try:
-    MonospacedFontsOption = QFontDialog.MonospacedFonts
+    MonospacedFontsOption = QFontDialog.FontDialogOption.MonospacedFonts
 except AttributeError:
     MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10)
 
@@ -38,47 +38,53 @@
         from QScintilla.QsciScintillaCompat import QsciScintillaCompat
         
         self.foldStyles = [
-            QsciScintilla.PlainFoldStyle,
-            QsciScintilla.CircledFoldStyle,
-            QsciScintilla.BoxedFoldStyle,
-            QsciScintilla.CircledTreeFoldStyle,
-            QsciScintilla.BoxedTreeFoldStyle,
+            QsciScintilla.FoldStyle.PlainFoldStyle,
+            QsciScintilla.FoldStyle.CircledFoldStyle,
+            QsciScintilla.FoldStyle.BoxedFoldStyle,
+            QsciScintilla.FoldStyle.CircledTreeFoldStyle,
+            QsciScintilla.FoldStyle.BoxedTreeFoldStyle,
             QsciScintillaCompat.ArrowFoldStyle,
             QsciScintillaCompat.ArrowTreeFoldStyle,
         ]
         
         self.edgeModes = [
-            QsciScintilla.EdgeNone,
-            QsciScintilla.EdgeLine,
-            QsciScintilla.EdgeBackground
+            QsciScintilla.EdgeMode.EdgeNone,
+            QsciScintilla.EdgeMode.EdgeLine,
+            QsciScintilla.EdgeMode.EdgeBackground
         ]
         
         self.wrapModeComboBox.addItem(
-            self.tr("Disabled"), QsciScintilla.WrapNone)
+            self.tr("Disabled"),
+            QsciScintilla.WrapMode.WrapNone)
         self.wrapModeComboBox.addItem(
-            self.tr("Word Boundary"), QsciScintilla.WrapWord)
+            self.tr("Word Boundary"),
+            QsciScintilla.WrapMode.WrapWord)
         self.wrapModeComboBox.addItem(
-            self.tr("Character Boundary"), QsciScintilla.WrapCharacter)
+            self.tr("Character Boundary"),
+            QsciScintilla.WrapMode.WrapCharacter)
         self.wrapVisualComboBox.addItem(
-            self.tr("No Indicator"), QsciScintilla.WrapFlagNone)
+            self.tr("No Indicator"),
+            QsciScintilla.WrapVisualFlag.WrapFlagNone)
         self.wrapVisualComboBox.addItem(
-            self.tr("Indicator by Text"), QsciScintilla.WrapFlagByText)
+            self.tr("Indicator by Text"),
+            QsciScintilla.WrapVisualFlag.WrapFlagByText)
         self.wrapVisualComboBox.addItem(
-            self.tr("Indicator by Margin"), QsciScintilla.WrapFlagByBorder)
+            self.tr("Indicator by Margin"),
+            QsciScintilla.WrapVisualFlag.WrapFlagByBorder)
         self.wrapVisualComboBox.addItem(
             self.tr("Indicator in Line Number Margin"),
-            QsciScintilla.WrapFlagInMargin)
+            QsciScintilla.WrapVisualFlag.WrapFlagInMargin)
         
         self.wrapIndentComboBox.addItem(
-            self.tr("Fixed"), QsciScintilla.WrapIndentFixed)
+            self.tr("Fixed"), QsciScintilla.WrapIndentMode.WrapIndentFixed)
         self.wrapIndentComboBox.addItem(
-            self.tr("Aligned"), QsciScintilla.WrapIndentSame)
+            self.tr("Aligned"), QsciScintilla.WrapIndentMode.WrapIndentSame)
         self.wrapIndentComboBox.addItem(
             self.tr("Aligned plus One"),
-            QsciScintilla.WrapIndentIndented)
+            QsciScintilla.WrapIndentMode.WrapIndentIndented)
         self.wrapIndentComboBox.addItem(
             self.tr("Aligned plus Two"),
-            QsciScintilla.WrapIndentDeeplyIndented)
+            QsciScintilla.WrapIndentMode.WrapIndentDeeplyIndented)
         
         # set initial values
         try:
@@ -435,25 +441,25 @@
         self.monospacedFontSample.setFont(self.monospacedFont)
         
         pl = self.annotationsWarningSample.palette()
-        pl.setColor(QPalette.Text,
+        pl.setColor(QPalette.ColorRole.Text,
                     self.editorColours["AnnotationsWarningForeground"])
-        pl.setColor(QPalette.Base,
+        pl.setColor(QPalette.ColorRole.Base,
                     self.editorColours["AnnotationsWarningBackground"])
         self.annotationsWarningSample.setPalette(pl)
         self.annotationsWarningSample.repaint()
         
         pl = self.annotationsErrorSample.palette()
-        pl.setColor(QPalette.Text,
+        pl.setColor(QPalette.ColorRole.Text,
                     self.editorColours["AnnotationsErrorForeground"])
-        pl.setColor(QPalette.Base,
+        pl.setColor(QPalette.ColorRole.Base,
                     self.editorColours["AnnotationsErrorBackground"])
         self.annotationsErrorSample.setPalette(pl)
         self.annotationsErrorSample.repaint()
         
         pl = self.annotationsStyleWarningSample.palette()
-        pl.setColor(QPalette.Text,
+        pl.setColor(QPalette.ColorRole.Text,
                     self.editorColours["AnnotationsStyleForeground"])
-        pl.setColor(QPalette.Base,
+        pl.setColor(QPalette.ColorRole.Base,
                     self.editorColours["AnnotationsStyleBackground"])
         self.annotationsStyleWarningSample.setPalette(pl)
         self.annotationsStyleWarningSample.repaint()
@@ -467,7 +473,7 @@
             self.editorColours["AnnotationsWarningForeground"])
         if colour.isValid():
             pl = self.annotationsWarningSample.palette()
-            pl.setColor(QPalette.Text, colour)
+            pl.setColor(QPalette.ColorRole.Text, colour)
             self.annotationsWarningSample.setPalette(pl)
             self.annotationsWarningSample.repaint()
             self.editorColours["AnnotationsWarningForeground"] = colour
@@ -481,7 +487,7 @@
             self.editorColours["AnnotationsWarningBackground"])
         if colour.isValid():
             pl = self.annotationsWarningSample.palette()
-            pl.setColor(QPalette.Base, colour)
+            pl.setColor(QPalette.ColorRole.Base, colour)
             self.annotationsWarningSample.setPalette(pl)
             self.annotationsWarningSample.repaint()
             self.editorColours["AnnotationsWarningBackground"] = colour
@@ -495,7 +501,7 @@
             self.editorColours["AnnotationsErrorForeground"])
         if colour.isValid():
             pl = self.annotationsErrorSample.palette()
-            pl.setColor(QPalette.Text, colour)
+            pl.setColor(QPalette.ColorRole.Text, colour)
             self.annotationsErrorSample.setPalette(pl)
             self.annotationsErrorSample.repaint()
             self.editorColours["AnnotationsErrorForeground"] = colour
@@ -509,7 +515,7 @@
             self.editorColours["AnnotationsErrorBackground"])
         if colour.isValid():
             pl = self.annotationsErrorSample.palette()
-            pl.setColor(QPalette.Base, colour)
+            pl.setColor(QPalette.ColorRole.Base, colour)
             self.annotationsErrorSample.setPalette(pl)
             self.annotationsErrorSample.repaint()
             self.editorColours["AnnotationsErrorBackground"] = colour
@@ -523,7 +529,7 @@
             self.editorColours["AnnotationsStyleForeground"])
         if colour.isValid():
             pl = self.annotationsStyleWarningSample.palette()
-            pl.setColor(QPalette.Text, colour)
+            pl.setColor(QPalette.ColorRole.Text, colour)
             self.annotationsStyleWarningSample.setPalette(pl)
             self.annotationsStyleWarningSample.repaint()
             self.editorColours["AnnotationsStyleForeground"] = colour
@@ -537,7 +543,7 @@
             self.editorColours["AnnotationsStyleBackground"])
         if colour.isValid():
             pl = self.annotationsStyleWarningSample.palette()
-            pl.setColor(QPalette.Base, colour)
+            pl.setColor(QPalette.ColorRole.Base, colour)
             self.annotationsStyleWarningSample.setPalette(pl)
             self.annotationsStyleWarningSample.repaint()
             self.editorColours["AnnotationsStyleackground"] = colour

eric ide

mercurial