mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-02 22:53:58 +00:00
Prevent text to be drawn over the clear edit icon
This commit is contained in:
@@ -87,6 +87,9 @@ class ButtonLineEdit(QtGui.QLineEdit):
|
||||
self.clear_button.setToolTip(_("Clear entry"))
|
||||
self.clear_button.clicked.connect(self.clear)
|
||||
self.textChanged.connect(self._update_clear_button)
|
||||
self._margins = self.getTextMargins()
|
||||
|
||||
def _update_clear_button(self, text):
|
||||
self.clear_button.setVisible(text != "")
|
||||
left, top, right, bottom = self._margins
|
||||
self.setTextMargins(left, top, right + self.clear_button.width(), bottom)
|
||||
|
||||
Reference in New Issue
Block a user