Added configuration options for visible whitespace (as of QScintilla 2.5) (for shell and terminal).

Thu, 10 Mar 2011 19:46:13 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 10 Mar 2011 19:46:13 +0100
changeset 943
1246bd8280a6
parent 942
1d2a6b8509c6
child 944
1b59c4ba121e

Added configuration options for visible whitespace (as of QScintilla 2.5) (for shell and terminal).

QScintilla/Shell.py file | annotate | diff | comparison | revisions
QScintilla/Terminal.py file | annotate | diff | comparison | revisions
--- a/QScintilla/Shell.py	Thu Mar 10 19:07:05 2011 +0100
+++ b/QScintilla/Shell.py	Thu Mar 10 19:46:13 2011 +0100
@@ -282,6 +282,16 @@
         self.setTabWidth(Preferences.getEditor("TabWidth"))
         if Preferences.getEditor("ShowWhitespace"):
             self.setWhitespaceVisibility(QsciScintilla.WsVisible)
+            try:
+                self.setWhitespaceForegroundColor(
+                    Preferences.getEditorColour("WhitespaceForeground"))
+                self.setWhitespaceBackgroundColor(
+                    Preferences.getEditorColour("WhitespaceBackground"))
+                self.setWhitespaceSize(
+                    Preferences.getEditor("WhitespaceSize"))
+            except AttributeError:
+                # QScintilla before 2.5 doesn't support this
+                pass
         else:
             self.setWhitespaceVisibility(QsciScintilla.WsInvisible)
         self.setEolVisibility(Preferences.getEditor("ShowEOL"))
--- a/QScintilla/Terminal.py	Thu Mar 10 19:07:05 2011 +0100
+++ b/QScintilla/Terminal.py	Thu Mar 10 19:46:13 2011 +0100
@@ -286,6 +286,16 @@
         self.setTabWidth(Preferences.getEditor("TabWidth"))
         if Preferences.getEditor("ShowWhitespace"):
             self.setWhitespaceVisibility(QsciScintilla.WsVisible)
+            try:
+                self.setWhitespaceForegroundColor(
+                    Preferences.getEditorColour("WhitespaceForeground"))
+                self.setWhitespaceBackgroundColor(
+                    Preferences.getEditorColour("WhitespaceBackground"))
+                self.setWhitespaceSize(
+                    Preferences.getEditor("WhitespaceSize"))
+            except AttributeError:
+                # QScintilla before 2.5 doesn't support this
+                pass
         else:
             self.setWhitespaceVisibility(QsciScintilla.WsInvisible)
         self.setEolVisibility(Preferences.getEditor("ShowEOL"))
@@ -930,4 +940,4 @@
         """
         Private method to open the configuration dialog.
         """
-        e5App().getObject("UserInterface").showPreferences("terminalPage")
\ No newline at end of file
+        e5App().getObject("UserInterface").showPreferences("terminalPage")

eric ide

mercurial