From c39dfdec964124115044a42e44cf9bfa94eb96bd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 10 Jul 2021 07:41:30 +0530 Subject: [PATCH] Hide clear buttons in book list editor widgets as space is at a premium there --- src/calibre/gui2/library/delegates.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index 39c5573365..ec890f503a 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -306,6 +306,7 @@ class TextDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{ if self.auto_complete_function: editor = EditWithComplete(parent) editor.set_separator(None) + editor.set_clear_button_enabled(False) complete_items = [i[1] for i in self.auto_complete_function()] editor.update_items_cache(complete_items) else: @@ -361,6 +362,7 @@ class CompleteDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{ if col == 'tags': editor.set_elide_mode(Qt.TextElideMode.ElideMiddle) editor.set_separator(self.sep) + editor.set_clear_button_enabled(False) editor.set_space_before_sep(self.space_before_sep) if self.sep == '&': editor.set_add_separator(tweaks['authors_completer_append_separator']) @@ -474,6 +476,7 @@ class CcTextDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{ if m.db.field_metadata[col]['datatype'] != 'comments': editor = EditWithComplete(parent) editor.set_separator(None) + editor.set_clear_button_enabled(False) complete_items = sorted(list(m.db.all_custom(label=key)), key=sort_key) editor.update_items_cache(complete_items) else: