Fixed another issue with the editor search bar and replace bar related to resizing upon usage of large fonts.

Wed, 28 Jan 2015 19:38:57 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 28 Jan 2015 19:38:57 +0100
changeset 4068
cb91ccf0104d
parent 4067
cdc77314be22
child 4069
5d46da4c2ce5

Fixed another issue with the editor search bar and replace bar related to resizing upon usage of large fonts.

QScintilla/SearchReplaceWidget.py file | annotate | diff | comparison | revisions
--- a/QScintilla/SearchReplaceWidget.py	Sun Jan 25 18:45:59 2015 +0100
+++ b/QScintilla/SearchReplaceWidget.py	Wed Jan 28 19:38:57 2015 +0100
@@ -9,7 +9,7 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot
+from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot, QEvent
 from PyQt5.QtWidgets import QWidget, QHBoxLayout, QToolButton, QScrollArea, \
     QSizePolicy, QFrame
 
@@ -171,6 +171,19 @@
         self.__selections = []
         self.__finding = False
     
+    def changeEvent(self, evt):
+        """
+        Protected method handling state changes.
+        
+        @param evt event containing the state change (QEvent)
+        """
+        if evt.type() == QEvent.FontChange:
+            self.ensurePolished()
+            msh = self.minimumSizeHint()
+            self.resize(max(self.width(), msh.width()),
+                        max(self.height(), msh.height())
+                        )
+    
     def __selectionBoundary(self, selections=None):
         """
         Private method to calculate the current selection boundary.

eric ide

mercurial