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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 28 Jan 2015 19:38:57 +0100
branch
6_0_x
changeset 4071
fb7a5fa9f239
parent 4070
28382ba99ba4
child 4075
f8757a7414b3

Fixed another issue with the editor search bar and replace bar related to resizing upon usage of large fonts.
(grafted from cb91ccf0104d8d9ce3019db0adad535e4b330720)

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