149 |
149 |
150 def _updateTextMargins(self): |
150 def _updateTextMargins(self): |
151 """ |
151 """ |
152 Protected slot to update the text margins. |
152 Protected slot to update the text margins. |
153 """ |
153 """ |
154 if self.__leftMargin == 0: |
154 left = ( |
155 left = self.__leftWidget.sizeHint().width() |
155 self.__leftWidget.sizeHint().width() |
156 else: |
156 if self.__leftMargin == 0 else |
157 left = self.__leftMargin |
157 self.__leftMargin |
|
158 ) |
158 right = self.__rightWidget.sizeHint().width() |
159 right = self.__rightWidget.sizeHint().width() |
159 top = 0 |
160 top = 0 |
160 bottom = 0 |
161 bottom = 0 |
161 self.setTextMargins(left, top, right, bottom) |
162 self.setTextMargins(left, top, right, bottom) |
162 |
163 |
220 E5LineEdit.RightSide) |
221 E5LineEdit.RightSide) |
221 @return text margin (integer) |
222 @return text margin (integer) |
222 """ |
223 """ |
223 spacing = self.__rightLayout.spacing() |
224 spacing = self.__rightLayout.spacing() |
224 w = 0 |
225 w = 0 |
225 if position == self.LeftSide: |
226 w = ( |
226 w = self.__leftWidget.sizeHint().width() |
227 self.__leftWidget.sizeHint().width() |
227 else: |
228 if position == self.LeftSide else |
228 w = self.__rightWidget.sizeHint().width() |
229 self.__rightWidget.sizeHint().width() |
|
230 ) |
229 if w == 0: |
231 if w == 0: |
230 return 0 |
232 return 0 |
231 return w + spacing * 2 |
233 return w + spacing * 2 |
232 |
234 |
233 def inactiveText(self): |
235 def inactiveText(self): |