E5Gui/E5SqueezeLabels.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 2990
583beaf0b4b8
child 3060
5883ce99ee12
diff -r 9986ec0e559a -r 10516539f238 E5Gui/E5SqueezeLabels.py
--- a/E5Gui/E5SqueezeLabels.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/E5Gui/E5SqueezeLabels.py	Fri Oct 18 23:00:41 2013 +0200
@@ -4,7 +4,8 @@
 #
 
 """
-Module implementing labels that squeeze their contents to fit the size of the label.
+Module implementing labels that squeeze their contents to fit the size of the
+label.
 """
 
 from __future__ import unicode_literals    # __IGNORE_WARNING__
@@ -38,7 +39,8 @@
         """
         fm = self.fontMetrics()
         if fm.width(self.__text) > self.contentsRect().width():
-            self.__elided = fm.elidedText(self.text(), Qt.ElideMiddle, self.width())
+            self.__elided = fm.elidedText(
+                self.text(), Qt.ElideMiddle, self.width())
             super(E5SqueezeLabel, self).setText(self.__elided)
         else:
             super(E5SqueezeLabel, self).setText(self.__text)
@@ -73,7 +75,8 @@
         """
         Public method to set the surrounding of the path string.
         
-        @param surrounding the a string containg placeholders for the path (string)
+        @param surrounding the a string containg placeholders for the path
+            (string)
         """
         self.__surrounding = surrounding
         super(E5SqueezeLabelPath, self).setText(self.__surrounding.format(self.__path))
@@ -91,7 +94,8 @@
         """
         Public method to set the surrounding and the path of the label.
         
-        @param surrounding the a string containg placeholders for the path (string)
+        @param surrounding the a string containg placeholders for the path
+            (string)
         @param path path to be shown (string)
         """
         self.__surrounding = surrounding
@@ -105,7 +109,8 @@
         @param event reference to the paint event (QPaintEvent)
         """
         fm = self.fontMetrics()
-        if fm.width(self.__surrounding.format(self.__path)) > self.contentsRect().width():
+        if (fm.width(self.__surrounding.format(self.__path)) > 
+                self.contentsRect().width()):
             super(E5SqueezeLabelPath, self).setText(
                 self.__surrounding.format(compactPath(self.__path,
                                           self.contentsRect().width(),

eric ide

mercurial