mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Harmonize selectall behavior for delegated editors in the book list with other places these editors are used
By not having special selectAll behavior in the book list we can control this system wide by changing the widget's initial selectall behavior centrally.
This commit is contained in:
parent
c726b61dcc
commit
b120cc9c03
@ -318,7 +318,6 @@ class TextDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{
|
||||
|
||||
def setEditorData(self, editor, index):
|
||||
editor.setText(get_val_for_textlike_columns(index))
|
||||
editor.selectAll()
|
||||
|
||||
def setModelData(self, editor, model, index):
|
||||
if isinstance(editor, EditWithComplete):
|
||||
@ -383,7 +382,6 @@ class CompleteDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{
|
||||
|
||||
def setEditorData(self, editor, index):
|
||||
editor.setText(get_val_for_textlike_columns(index))
|
||||
editor.selectAll()
|
||||
|
||||
def setModelData(self, editor, model, index):
|
||||
if isinstance(editor, EditWithComplete):
|
||||
@ -493,12 +491,10 @@ class CcTextDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{
|
||||
text = index.data(Qt.ItemDataRole.DisplayRole)
|
||||
if text:
|
||||
editor.setText(text)
|
||||
editor.selectAll()
|
||||
return editor
|
||||
|
||||
def setEditorData(self, editor, index):
|
||||
editor.setText(get_val_for_textlike_columns(index))
|
||||
editor.selectAll()
|
||||
|
||||
def setModelData(self, editor, model, index):
|
||||
val = editor.text() or ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user