From b3fd42a91292aaadc9b234aad67e331254103169 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Tue, 4 Oct 2022 09:13:57 +0100 Subject: [PATCH] Bug #1991571: 'Clear' button on short longtext columns. Changed look to be like the other widgets. --- src/calibre/gui2/custom_column_widgets.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py index d94f258e67..ab59783f24 100644 --- a/src/calibre/gui2/custom_column_widgets.py +++ b/src/calibre/gui2/custom_column_widgets.py @@ -138,10 +138,11 @@ class Base: class SimpleText(Base): def setup_ui(self, parent): - self.editor = QLineEdit(parent) - self.widgets = [QLabel(label_string(self.col_metadata['name']), parent), - self.editor] - self.editor.setClearButtonEnabled(True) + self.widgets = [QLabel(label_string(self.col_metadata['name']), parent),] + self.finish_ui_setup(parent, QLineEdit) + + def set_to_undefined(self): + self.editor.setText('') def setter(self, val): self.editor.setText(str(val or ''))