eric6/E5Gui/E5LineEdit.py

changeset 8257
28146736bbfc
parent 8218
7c09585bd960
child 8268
6b8128e0c9d1
--- a/eric6/E5Gui/E5LineEdit.py	Tue Apr 20 19:38:10 2021 +0200
+++ b/eric6/E5Gui/E5LineEdit.py	Tue Apr 20 19:47:39 2021 +0200
@@ -151,10 +151,11 @@
         """
         Protected slot to update the text margins.
         """
-        if self.__leftMargin == 0:
-            left = self.__leftWidget.sizeHint().width()
-        else:
-            left = self.__leftMargin
+        left = (
+            self.__leftWidget.sizeHint().width()
+            if self.__leftMargin == 0 else
+            self.__leftMargin
+        )
         right = self.__rightWidget.sizeHint().width()
         top = 0
         bottom = 0
@@ -222,10 +223,11 @@
         """
         spacing = self.__rightLayout.spacing()
         w = 0
-        if position == self.LeftSide:
-            w = self.__leftWidget.sizeHint().width()
-        else:
-            w = self.__rightWidget.sizeHint().width()
+        w = (
+            self.__leftWidget.sizeHint().width()
+            if position == self.LeftSide else
+            self.__rightWidget.sizeHint().width()
+        )
         if w == 0:
             return 0
         return w + spacing * 2

eric ide

mercurial