RefactoringRope/PreviewDialogBase.py

changeset 343
c40aa744ed47
parent 326
67bcde9c65b9
child 346
877cac2e8d94
diff -r 0a18c09cb9eb -r c40aa744ed47 RefactoringRope/PreviewDialogBase.py
--- a/RefactoringRope/PreviewDialogBase.py	Wed Oct 14 19:11:44 2020 +0200
+++ b/RefactoringRope/PreviewDialogBase.py	Sat Nov 21 16:40:59 2020 +0100
@@ -10,12 +10,13 @@
 from __future__ import unicode_literals
 
 from PyQt5.QtCore import Qt
-from PyQt5.QtGui import QBrush, QColor, QTextCursor
+from PyQt5.QtGui import QBrush, QTextCursor
 from PyQt5.QtWidgets import QDialog
 
 from .Ui_PreviewDialog import Ui_PreviewDialog
 
 import Globals
+import Preferences
 
 
 class PreviewDialogBase(QDialog, Ui_PreviewDialog):
@@ -40,20 +41,30 @@
         
         self.formats = {}
         self.formats[' '] = self.previewEdit.currentCharFormat()
+        
         charFormat = self.previewEdit.currentCharFormat()
-        charFormat.setBackground(QBrush(QColor(190, 237, 190)))
+        charFormat.setBackground(
+            QBrush(Preferences.getDiffColour("AddedColor")))
         self.formats['+'] = charFormat
+        
         charFormat = self.previewEdit.currentCharFormat()
-        charFormat.setBackground(QBrush(QColor(237, 190, 190)))
+        charFormat.setBackground(
+            QBrush(Preferences.getDiffColour("RemovedColor")))
         self.formats['-'] = charFormat
+        
         charFormat = self.previewEdit.currentCharFormat()
-        charFormat.setBackground(QBrush(QColor(190, 190, 237)))
+        charFormat.setBackground(
+            QBrush(Preferences.getDiffColour("ReplacedColor")))
         self.formats['@'] = charFormat
+        
         charFormat = self.previewEdit.currentCharFormat()
-        charFormat.setBackground(QBrush(QColor(124, 124, 124)))
+        charFormat.setBackground(
+            QBrush(Preferences.getDiffColour("ContextColor")))
         self.formats['?'] = charFormat
+        
         charFormat = self.previewEdit.currentCharFormat()
-        charFormat.setBackground(QBrush(QColor(190, 190, 190)))
+        charFormat.setBackground(
+            QBrush(Preferences.getDiffColour("HeaderColor")))
         self.formats['='] = charFormat
     
     def _appendText(self, txt, charFormat):

eric ide

mercurial