eric6/QScintilla/Editor.py

branch
maintenance
changeset 8576
fe1957c69854
parent 8400
b3eefd7e58d1
parent 8502
c600634511d0
--- a/eric6/QScintilla/Editor.py	Sat Jul 03 11:47:48 2021 +0200
+++ b/eric6/QScintilla/Editor.py	Sat Sep 04 11:34:54 2021 +0200
@@ -16,7 +16,7 @@
 
 from PyQt5.QtCore import (
     pyqtSignal, pyqtSlot, Qt, QDir, QTimer, QModelIndex, QFileInfo,
-    QCryptographicHash, QEvent, QDateTime, QPoint
+    QCryptographicHash, QEvent, QDateTime, QPoint, QSize
 )
 from PyQt5.QtGui import QPalette, QFont, QPixmap, QPainter
 from PyQt5.QtWidgets import (
@@ -585,36 +585,53 @@
         """
         Private method to register images for autocompletion lists.
         """
-        self.registerImage(self.ClassID,
-                           UI.PixmapCache.getPixmap("class"))
-        self.registerImage(self.ClassProtectedID,
-                           UI.PixmapCache.getPixmap("class_protected"))
-        self.registerImage(self.ClassPrivateID,
-                           UI.PixmapCache.getPixmap("class_private"))
-        self.registerImage(self.MethodID,
-                           UI.PixmapCache.getPixmap("method"))
-        self.registerImage(self.MethodProtectedID,
-                           UI.PixmapCache.getPixmap("method_protected"))
-        self.registerImage(self.MethodPrivateID,
-                           UI.PixmapCache.getPixmap("method_private"))
-        self.registerImage(self.AttributeID,
-                           UI.PixmapCache.getPixmap("attribute"))
-        self.registerImage(self.AttributeProtectedID,
-                           UI.PixmapCache.getPixmap("attribute_protected"))
-        self.registerImage(self.AttributePrivateID,
-                           UI.PixmapCache.getPixmap("attribute_private"))
-        self.registerImage(self.EnumID,
-                           UI.PixmapCache.getPixmap("enum"))
-        self.registerImage(self.KeywordsID,
-                           UI.PixmapCache.getPixmap("keywords"))
-        self.registerImage(self.ModuleID,
-                           UI.PixmapCache.getPixmap("module"))
-        
-        self.registerImage(self.FromDocumentID,
-                           UI.PixmapCache.getPixmap("editor"))
-        
-        self.registerImage(self.TemplateImageID,
-                           UI.PixmapCache.getPixmap("templateViewer"))
+        # finale size of the completion images
+        imageSize = QSize(22, 22)
+        
+        self.registerImage(
+            self.ClassID,
+            UI.PixmapCache.getPixmap("class", imageSize))
+        self.registerImage(
+            self.ClassProtectedID,
+            UI.PixmapCache.getPixmap("class_protected", imageSize))
+        self.registerImage(
+            self.ClassPrivateID,
+            UI.PixmapCache.getPixmap("class_private", imageSize))
+        self.registerImage(
+            self.MethodID,
+            UI.PixmapCache.getPixmap("method", imageSize))
+        self.registerImage(
+            self.MethodProtectedID,
+            UI.PixmapCache.getPixmap("method_protected", imageSize))
+        self.registerImage(
+            self.MethodPrivateID,
+            UI.PixmapCache.getPixmap("method_private", imageSize))
+        self.registerImage(
+            self.AttributeID,
+            UI.PixmapCache.getPixmap("attribute", imageSize))
+        self.registerImage(
+            self.AttributeProtectedID,
+            UI.PixmapCache.getPixmap("attribute_protected", imageSize))
+        self.registerImage(
+            self.AttributePrivateID,
+            UI.PixmapCache.getPixmap("attribute_private", imageSize))
+        self.registerImage(
+            self.EnumID,
+            UI.PixmapCache.getPixmap("enum", imageSize))
+        self.registerImage(
+            self.KeywordsID,
+            UI.PixmapCache.getPixmap("keywords", imageSize))
+        self.registerImage(
+            self.ModuleID,
+            UI.PixmapCache.getPixmap("module", imageSize))
+        
+        self.registerImage(
+            self.FromDocumentID,
+            UI.PixmapCache.getPixmap("editor", imageSize))
+        
+        self.registerImage(
+            self.TemplateImageID,
+            UI.PixmapCache.getPixmap("templateViewer", imageSize))
     
     def addClone(self, editor):
         """
@@ -4440,7 +4457,7 @@
             Preferences.getEditor("ShowMarkerMapOnRight"))
         self.__markerMap.initColors()
         
-        self.setLanguage(self.fileName)
+        self.setLanguage(self.fileName, propagate=False)
         
         self.settingsRead.emit()
     
@@ -4743,8 +4760,10 @@
             self.setAutoCompletionSource(
                 QsciScintilla.AutoCompletionSource.AcsAll)
         
-        self.maxLines = Preferences.getEditor("AutoCompletionMaxLines")
-        self.maxChars = Preferences.getEditor("AutoCompletionMaxChars")
+        self.setAutoCompletionWidgetSize(
+            Preferences.getEditor("AutoCompletionMaxChars"),
+            Preferences.getEditor("AutoCompletionMaxLines")
+        )
         
     def __setCallTips(self):
         """

eric ide

mercurial